mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-14 15:44:47 +02:00
GNOME: pin the Return to Gaming Mode launcher to the dash; relogin waits for the runtime dir
Sync git.upriser.nl mirror / sync (push) Skipped
Sync git.upriser.nl mirror / sync (push) Skipped
This commit is contained in:
1 parent
f2b5f84526
commit
4f095bd077
2 files changed
+28
-1
No files matched your search
@@ -77,6 +77,7 @@ EOF
|
||||
cp "$shortcut_path" "$user_home/.local/share/applications/steamify-return-to-gaming-mode.desktop"
|
||||
# GNOME only starts launchers it trusts.
|
||||
gio set "$shortcut_path" metadata::trusted true 2>/dev/null || true
|
||||
gnome_dash_pin
|
||||
fi
|
||||
|
||||
ok "Desktop shortcut created successfully."
|
||||
@@ -94,5 +95,29 @@ remove_desktop_shortcut() {
|
||||
local desktop_dir
|
||||
desktop_dir="$(xdg-user-dir DESKTOP 2>/dev/null || echo "$HOME/Desktop")"
|
||||
rm -f "$desktop_dir/Return to Gaming Mode.desktop" "$HOME/.local/share/applications/steamify-return-to-gaming-mode.desktop"
|
||||
gnome_dash_unpin
|
||||
sudo rm -f /etc/sudoers.d/gamescope-session-switch
|
||||
}
|
||||
|
||||
# GNOME draws no icons on the desktop: the shortcut is pinned to the dash
|
||||
# (the favorites bar) as well. Only in a running session (gsettings needs its dconf).
|
||||
GNOME_SHORTCUT_ID=steamify-return-to-gaming-mode.desktop
|
||||
|
||||
gnome_dash_pin() {
|
||||
user_session && command -v gsettings >/dev/null || return 0
|
||||
local favorites
|
||||
favorites="$(gsettings get org.gnome.shell favorite-apps 2>/dev/null)" || return 0
|
||||
[[ "$favorites" == *"$GNOME_SHORTCUT_ID"* ]] && return 0
|
||||
favorites="$(sed "s/\]\$/, '$GNOME_SHORTCUT_ID']/; s/^\[, /[/; s/\[\], /[/" <<< "$favorites")"
|
||||
[[ "$favorites" == "[ '$GNOME_SHORTCUT_ID']" ]] && favorites="['$GNOME_SHORTCUT_ID']"
|
||||
gsettings set org.gnome.shell favorite-apps "$favorites"
|
||||
}
|
||||
|
||||
gnome_dash_unpin() {
|
||||
user_session && command -v gsettings >/dev/null || return 0
|
||||
local favorites
|
||||
favorites="$(gsettings get org.gnome.shell favorite-apps 2>/dev/null)" || return 0
|
||||
[[ "$favorites" == *"$GNOME_SHORTCUT_ID"* ]] || return 0
|
||||
favorites="$(sed -e "s/, '$GNOME_SHORTCUT_ID'//; s/'$GNOME_SHORTCUT_ID', //; s/'$GNOME_SHORTCUT_ID'//" <<< "$favorites")"
|
||||
gsettings set org.gnome.shell favorite-apps "$favorites"
|
||||
}
|
||||
Reference in new issue
Block a user