mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-03-29 22:20:21 +00:00
feat(deck): Add service to return to gaming mode
Fixes users not being to switch to gaming mode when they have desktop autologin toggled and should allow users to start gaming mode immediately after Steam has been updated instead of having to reboot after setup (although this should be done regardless)
This commit is contained in:
parent
91b0c86063
commit
64ef129f7c
22
system_files/deck/shared/usr/bin/return-to-gamemode
Executable file
22
system_files/deck/shared/usr/bin/return-to-gamemode
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source /etc/default/bazzite
|
||||
|
||||
USER=$(id -nu 1000)
|
||||
|
||||
# SteamOS autologin SDDM config
|
||||
AUTOLOGIN_CONF='/etc/sddm.conf.d/zz-steamos-autologin.conf'
|
||||
|
||||
# Configure autologin if Steam has been updated
|
||||
if [[ -f /var/home/$USER/.local/share/Steam/ubuntu12_32/steamui.so ]]; then
|
||||
{
|
||||
echo "[Autologin]"
|
||||
echo "Session=gamescope-session.desktop"
|
||||
} > "$AUTOLOGIN_CONF"
|
||||
fi
|
||||
|
||||
if [[ $BASE_IMAGE_NAME = "kinoite" ]]; then
|
||||
sudo -Eu $USER qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logout
|
||||
elif [[ $BASE_IMAGE_NAME = "silverblue" ]]; then
|
||||
sudo -Eu $USER gnome-session-quit --logout --no-prompt
|
||||
fi
|
@ -0,0 +1,8 @@
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (subject.isInGroup("wheel") &&
|
||||
action.id == "org.freedesktop.systemd1.manage-units" &&
|
||||
action.lookup("unit") == "return-to-gamemode.service")
|
||||
{
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Return to Gaming Mode
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/return-to-gamemode
|
Loading…
x
Reference in New Issue
Block a user