Skip to content

Commit

Permalink
Merge pull request #48 from ublue-os/main
Browse files Browse the repository at this point in the history
[pull] main from ublue-os:main
  • Loading branch information
pull[bot] authored Jan 19, 2025
2 parents b8a09b5 + de806bd commit b9e91f2
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/bash

sudo waydroid container restart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=Force Restart Waydroid
Exec=pkexec /usr/libexec/waydroid-container-restart
Categories=X-WayDroid-App;
X-Purism-FormFactor=Workstation;Mobile;
Icon=waydroid
NoDisplay=false
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/waydroid-container-stop</annotate>
</action>

<action id="org.bazzite.policykit.waydroid.container.restart">
<description>Restart Waydroid Container</description>
<icon_name>package-x-generic</icon_name>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/waydroid-container-restart</annotate>
</action>

<action id="org.bazzite.policykit.waydroid.fix.controllers">
<description>Fix Controllers in Waydroid</description>
<icon_name>package-x-generic</icon_name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
polkit.addRule(function(action, subject) {
if ((action.id == "org.bazzite.policykit.waydroid.container.start" ||
action.id == "org.bazzite.policykit.waydroid.container.stop" ||
action.id == "org.bazzite.policykit.waydroid.container.restart" ||
action.id == "org.bazzite.policykit.waydroid.fix.controllers") &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ alias changelog := changelogs

# Show the stable changelog
changelogs:
curl -s https://api.github.com/repos/ublue-os/bazzite/releases/latest | jq -r '.body'
#!/usr/bin/bash
CONTENT=$(curl -s https://api.github.com/repos/ublue-os/bazzite/releases/latest | jq -r '.body')
echo "$CONTENT" | glow -

# Show the testing (pre-release) changelog
changelogs-testing:
curl -s https://api.github.com/repos/ublue-os/bazzite/releases | jq -r 'map(select(.prerelease)) | .[0].body'
#!/usr/bin/bash
CCONTENT=$(curl -s https://api.github.com/repos/ublue-os/bazzite/releases | jq -r 'map(select(.prerelease)) | .[0].body')
echo "$CONTENT" | glow -
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,83 @@ toggle-bt-mic:
else
echo "No changes were made."
fi

toggle-i915-sleep-fix:
#!/usr/bin/bash
# Explain the purpose of the script
echo -e "This script manages the i915.enable_dc kernel parameter, which controls a power-saving feature for Intel graphics"
echo -e "Enabling this setting can reduce power consumption, but may cause issues like random reboots or failed suspend on certain devices"
echo -e "Disabling it ensures stability at the cost of slightly higher power usage"
# Get the current i915.enable_dc setting
get_current_status() {
local karg_status
karg_status=$(cat /proc/cmdline | grep -o 'i915.enable_dc=[-0-9]' | cut -d= -f2)
if [[ -z "$karg_status" ]]; then
echo "Not Set"
else
echo "$karg_status"
fi
}
# Toggle i915.enable_dc kernel parameter
update_karg() {
local new_value=$1
if [[ $new_value -ge 0 && $new_value -le 4 ]]; then
echo -e "\nYou are setting power-saving mode (i915.enable_dc=$new_value).\n"
if [[ $new_value -eq 0 ]]; then
echo -e "This disables power-saving mode and prioritizes stability.\n"
elif [[ $new_value -eq 1 ]]; then
echo -e "This enables basic power-saving mode but may cause minor stability issues.\n"
elif [[ $new_value -ge 2 ]]; then
echo -e "This enables higher levels of power-saving mode, which may impact stability further.\n"
fi
elif [[ $new_value -eq -1 ]]; then
echo -e "\nYou are setting power-saving mode to auto (i915.enable_dc=-1).\n"
else
echo -e "\nInvalid value for i915.enable_dc. Please choose a valid value.\n"
return
fi
sudo rpm-ostree kargs --replace "i915.enable_dc=$new_value"
echo -e "Kernel parameter updated. Reboot required to apply changes."
}
# Display current status
current_status=$(get_current_status)
echo -e "\nCurrent i915.enable_dc setting: $current_status\n"
# Prompt user for action
CHOICE=$(ugum choose "Set to Auto (i915.enable_dc=-1)" "Disable Power Saving (i915.enable_dc=0)" "Set to Level 1 (i915.enable_dc=1)" "Set to Level 2 (i915.enable_dc=2)" "Set to Level 3 (i915.enable_dc=3)" "Set to Level 4 (i915.enable_dc=4)" "Unset Parameter" "Exit without changes")
case "$CHOICE" in
"Set to Auto (i915.enable_dc=-1)")
echo "Setting power-saving mode to auto (i915.enable_dc=-1)..."
update_karg -1
;;
"Disable Power Saving (i915.enable_dc=0)")
echo "Disabling power-saving mode (i915.enable_dc=0)..."
update_karg 0
;;
"Set to Level 1 (i915.enable_dc=1)")
echo "Setting power-saving mode to level 1 (i915.enable_dc=1)..."
update_karg 1
;;
"Set to Level 2 (i915.enable_dc=2)")
echo "Setting power-saving mode to level 2 (i915.enable_dc=2)..."
update_karg 2
;;
"Set to Level 3 (i915.enable_dc=3)")
echo "Setting power-saving mode to level 3 (i915.enable_dc=3)..."
update_karg 3
;;
"Set to Level 4 (i915.enable_dc=4)")
echo "Setting power-saving mode to level 4 (i915.enable_dc=4)..."
update_karg 4
;;
"Unset Parameter")
echo "Unsetting i915.enable_dc..."
sudo rpm-ostree kargs --delete "i915.enable_dc=[-0-9]"
echo -e "Kernel parameter unset. Reboot required to apply changes."
;;
"Exit without changes")
echo "No changes made."
;;
*)
echo "Invalid choice. Exiting without changes."
;;
esac
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,32 @@ install-steamcmd:

# Install OpenRazer for Razer gaming hardware
install-openrazer:
sudo wget https://download.opensuse.org/repositories/hardware:/razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo -O /etc/yum.repos.d/hardware:razer.repo && \
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
OPENRAZER_CONFIGURATOR_APP="None of openrazer frontend apps"
sudo curl -Lo /etc/yum.repos.d/hardware:razer.repo https://openrazer.github.io/hardware:razer.repo && \
ublue-update --wait && \
rpm-ostree install -y openrazer-meta razergenie && \
if ! grep -q "plugdev" /etc/group; then \
rpm-ostree install -y openrazer-daemon && \
if ! grep -q "plugdev" /etc/group; then \
sudo bash -c 'grep "plugdev" /lib/group >> /etc/group' \
; fi && \
sudo usermod -a -G plugdev $USER && \
echo "${bold}Select OpenRazer Frontend Apps${normal}"
OPTION=$(Choose "Razer Genie" "Polychromatic" "None")
if [[ "${OPTION,,}" =~ ^razer[[:space:]]genie ]]; then
echo "Installing Razer Genie..."
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --system install -y flathub xyz.z3ntu.razergenie
OPENRAZER_CONFIGURATOR_APP="Razer Genie"
elif [[ "${OPTION,,}" =~ ^polychromatic ]]; then
echo "Installing Polychromatic..."
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak --system install -y flathub app.polychromatic.controller
OPENRAZER_CONFIGURATOR_APP="Polychromatic"
else
echo "Not Selecting GUI Frontend"
fi
echo "$OPENRAZER_CONFIGURATOR_APP is installed"
echo "Please reboot to apply needed changes."

# Install EmuDeck (https://www.emudeck.com/)
Expand Down Expand Up @@ -136,7 +155,8 @@ install-opentabletdriver:
flatpak --system install -y flathub net.opentabletdriver.OpenTabletDriver && \
mkdir -p $HOME/.config/OpenTabletDriver && \
flatpak override --user --filesystem=xdg-config/OpenTabletDriver net.opentabletdriver.OpenTabletDriver && \
curl -s https://raw.githubusercontent.com/flathub/net.opentabletdriver.OpenTabletDriver/refs/heads/master/scripts/opentabletdriver.service > ~/.config/systemd/user/opentabletdriver.service && \
mkdir -p $HOME/.config/systemd/user && \
curl -s https://raw.githubusercontent.com/flathub/net.opentabletdriver.OpenTabletDriver/refs/heads/master/scripts/opentabletdriver.service > $HOME/.config/systemd/user/opentabletdriver.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now opentabletdriver.service

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ setup-waydroid ACTION="":
fi
sudo waydroid init -c 'https://ota.waydro.id/system' -v 'https://ota.waydro.id/vendor'
sudo restorecon -R /var/lib/waydroid
cp /usr/share/applications/waydroid-container-restart.desktop ~/.local/share/applications
echo "Waydroid has been initialized, please run waydroid once before you Configure Waydroid"
elif [[ "${OPTION,,}" =~ ^configure ]]; then
git clone https://github.com/ublue-os/waydroid_script.git --depth 1 /tmp/waydroid_script
Expand Down

0 comments on commit b9e91f2

Please sign in to comment.