From f21b37a77ab06f0ed7f4e509f9f5647516b367a6 Mon Sep 17 00:00:00 2001 From: theupriser Date: Wed, 14 Oct 2026 13:51:49 +0200 Subject: [PATCH] GNOME: desktop icons through the Desktop Icons NG extension --- lib/desktop-shortcut.sh | 17 +++++++++++++++++ lib/packages.sh | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/desktop-shortcut.sh b/lib/desktop-shortcut.sh index 8b440d7..2384ee3 100644 --- a/lib/desktop-shortcut.sh +++ b/lib/desktop-shortcut.sh @@ -78,6 +78,7 @@ EOF # GNOME only starts launchers it trusts. gio set "$shortcut_path" metadata::trusted true 2>/dev/null || true gnome_dash_pin + gnome_desktop_icons_enable fi ok "Desktop shortcut created successfully." @@ -121,3 +122,19 @@ gnome_dash_unpin() { favorites="$(sed -e "s/, '$GNOME_SHORTCUT_ID'//; s/'$GNOME_SHORTCUT_ID', //; s/'$GNOME_SHORTCUT_ID'//" <<< "$favorites")" gsettings set org.gnome.shell favorite-apps "$favorites" } + +# Desktop icons on GNOME (it draws none itself): the Desktop Icons NG extension, +# installed with the other GNOME packages (lib/packages.sh). Enabled in the +# user's settings; GNOME loads a new extension at the next login. +DING_UUID=ding@rastersoft.com + +gnome_desktop_icons_enable() { + user_session && command -v gsettings >/dev/null || return 0 + [[ -d "/usr/share/gnome-shell/extensions/$DING_UUID" ]] || return 0 + local enabled + enabled="$(gsettings get org.gnome.shell enabled-extensions 2>/dev/null)" || return 0 + [[ "$enabled" == *"$DING_UUID"* ]] && return 0 + if [[ "$enabled" == "@as []" || "$enabled" == "[]" ]]; then enabled="['$DING_UUID']" + else enabled="${enabled%]}, '$DING_UUID']"; fi + gsettings set org.gnome.shell enabled-extensions "$enabled" +} diff --git a/lib/packages.sh b/lib/packages.sh index 8c657bc..f5c83b0 100644 --- a/lib/packages.sh +++ b/lib/packages.sh @@ -86,7 +86,7 @@ install_required_packages() { # Step 2: gamescope/Steam and the desktop helpers the rest of the setup uses. local -a MISSING required=(gamescope-session-cachyos steam mangohud xterm ttf-liberation wqy-zenhei) # Plasma's on-screen keyboard; on GNOME kconfig instead, for the kreadconfig6/kwriteconfig6 Steamify's undo journal uses. - if [[ "$(desktop_kind)" == gnome ]]; then required+=(kconfig accountsservice); else required+=(plasma-keyboard); fi + if [[ "$(desktop_kind)" == gnome ]]; then required+=(kconfig accountsservice gnome-shell-extension-desktop-icons-ng); else required+=(plasma-keyboard); fi info "Checking required packages: ${required[*]}" mapfile -t MISSING < <(pacman -T "${required[@]}")