Turning everything off gives GNOME back the desktop and tray icon extensions Steamify added

This commit is contained in:
theupriser committed 2026-10-15 21:07:15 +02:00
1 parent e9b7031bec
commit 063b5a8032
5 files changed
+61

No files matched your search

+45
View File
@@ -141,3 +141,48 @@ gnome_extensions_enable() {
gsettings set org.gnome.shell enabled-extensions "$enabled"
done
}
# The packages behind them. Needed by the SteamOS conversion (the desktop shortcut's icon, Steam's tray icon) and by the
# GNOME theme (its desktop and tray icons); a PC that has neither any more gets back what Steamify added.
GNOME_EXTRA_PKGS=(gnome-shell-extension-desktop-icons-ng gnome-shell-extension-appindicator extension-manager)
gnome_extras_note_missing() {
# Before they are installed: which of them Steamify brings itself (the others were the user's: they stay), one name per
# line in a file of its own, not a state value: kwriteconfig6 (kconfig) is one of the packages installed in that step.
# Already noted ones stay noted (they are installed by then, so they aren't "missing" again).
local p list="$STATE_DIR/gnomeextras.list"
mkdir -p "$STATE_DIR"
for p in "${GNOME_EXTRA_PKGS[@]}"; do
pacman -Q "$p" >/dev/null 2>&1 || grep -qxF "$p" "$list" 2>/dev/null || echo "$p" >> "$list"
done
}
gnome_extensions_disable() {
# The two out of the user's list of enabled extensions again.
user_session && command -v gsettings >/dev/null || return 0
local uuid enabled
for uuid in "${GNOME_EXTENSIONS[@]}"; do
enabled="$(gsettings get org.gnome.shell enabled-extensions 2>/dev/null)" || return 0
[[ "$enabled" == *"$uuid"* ]] || continue
enabled="$(sed -e "s/'$uuid', //; s/, '$uuid'//; s/'$uuid'//" <<<"$enabled")"
[[ "$enabled" == "[]" ]] && enabled="@as []"
gsettings set org.gnome.shell enabled-extensions "$enabled"
done
}
gnome_extras_release() {
# Called when the SteamOS conversion or the GNOME theme was turned off, after its own undoing. While the other one is
# still on, the extensions stay (and are enabled again: the theme's undo puts back the list it found). When neither is:
# they are disabled, and the packages Steamify installed are removed (a failed removal, because something else needs a
# package, keeps it).
[[ "$(desktop_kind)" == gnome ]] || return 0
if gaming_status || gnometheme_status; then gnome_extensions_enable; return 0; fi
gnome_extensions_disable
local p list="$STATE_DIR/gnomeextras.list"
for p in "${GNOME_EXTRA_PKGS[@]}"; do
grep -qxF "$p" "$list" 2>/dev/null || continue
pacman -Q "$p" >/dev/null 2>&1 || continue
sudo pacman -R --noconfirm "$p" >/dev/null 2>&1 || info "Keeping $p installed (another package needs it)."
done
rm -f "$list"
}
+12
View File
@@ -111,6 +111,15 @@ gnometheme_shell() {
done
}
gnometheme_extras_install() {
# The desktop icons and the tray icons of the Ubuntu-style look: Desktop Icons NG and AppIndicator (and Extension Manager
# for them), the same the SteamOS conversion needs (lib/desktop-shortcut.sh). Not fatal: the theme works without them.
gnome_extras_note_missing
sudo pacman -S --needed --noconfirm "${GNOME_EXTRA_PKGS[@]}" >/dev/null 2>&1 ||
{ warn "Couldn't install Desktop Icons NG and AppIndicator: the desktop and the tray show no icons."; return 0; }
gnome_extensions_enable
}
gnometheme_relogin_needed() {
# A GNOME session is running and this run changed the theme: GNOME Shell on Wayland can't be restarted in place, so
# the new extensions, the dock and the Settings panel show after the user logs in again.
@@ -186,6 +195,7 @@ gnometheme_enable() {
fi
{ echo "$GNOME_THEME_MARK"; patch_file steamify-gnome-gtk4.css; } > "$GNOME_THEME_CSS"
gnometheme_shell
gnometheme_extras_install
gnometheme_settings_install
ok "SteamOS theme for GNOME on (apps pick up the colors when they start again)."
# (GNOME Shell on Wayland can't restart in place: the app offers "Restart GNOME", which is this.)
@@ -227,5 +237,7 @@ gnometheme_disable() {
info "Keeping GNOME Settings with the Desktop panel (the stock one couldn't be installed)."
fi
state_clear gnometheme
# (After the state is cleared and the stylesheet is gone: the theme itself is off for gnome_extras_release's check.)
gnome_extras_release
ok "Previous GNOME look restored."
}
+1
View File
@@ -153,6 +153,7 @@ gaming_disable() {
os_name_disable
# NVIDIA with single user mode still on: nothing else logs in by itself any more.
nvidia_present && single_status && single_login_enable
gnome_extras_release
ok "The PC boots to the normal login screen again (from the next boot)."
}
+2
View File
@@ -92,6 +92,8 @@ install_required_packages() {
if [[ ${#MISSING[@]} -gt 0 ]]; then
python_hid_shim_ensure || return 1
# (What the GNOME extensions need is noted first: turning everything off removes what Steamify installed.)
[[ "$(desktop_kind)" == gnome ]] && gnome_extras_note_missing
info "Installing missing packages: ${MISSING[*]}"
sudo pacman -S --needed --noconfirm "${MISSING[@]}" || { err "Package installation failed."; return 1; }
else