diff options
| author | Don Williams <don.e.williams@gmail.com> | 2025-09-20 13:44:10 -0400 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2025-09-20 13:44:10 -0400 |
| commit | 3da2f5e614c796372c76967afbb41a6ae5d5a41d (patch) | |
| tree | 25672fcf1ffe5c4b4b5e9dc5ea2d83269c0590e4 /config/hypr/UserScripts/WallpaperSelect.sh | |
| parent | 88f1b4d4ebbcdb58daecbbee2c0cdab791366452 (diff) | |
fix(sddm): set Backgrounds/default as primary and update fallbacks; detect themes dir (incl. NixOS) and skip prompt on read-only paths
- Prefer Backgrounds/default for simple_sddm_2; update default.jpg/png if present
- Detect SDDM themes dir under /usr/share and /run/current-system
- Avoid prompting when theme is missing or Backgrounds is not writable (e.g., NixOS)
- Skip runtime changes on NixOS since SDDM isn’t used in that config
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index a08b53ce..466832ba 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -101,9 +101,21 @@ menu() { # Offer SDDM Simple Wallpaper Option (only for non-video wallpapers) set_sddm_wallpaper() { sleep 1 - sddm_simple="/usr/share/sddm/themes/simple_sddm_2" - if [ -d "$sddm_simple" ]; then + # Resolve SDDM themes directory (standard and NixOS path) + local sddm_themes_dir="" + if [ -d "/usr/share/sddm/themes" ]; then + sddm_themes_dir="/usr/share/sddm/themes" + elif [ -d "/run/current-system/sw/share/sddm/themes" ]; then + sddm_themes_dir="/run/current-system/sw/share/sddm/themes" + fi + + [ -z "$sddm_themes_dir" ] && return 0 + + local sddm_simple="$sddm_themes_dir/simple_sddm_2" + + # Only prompt if theme exists and its Backgrounds directory is writable + if [ -d "$sddm_simple" ] && [ -w "$sddm_simple/Backgrounds" ]; then # Check if yad is running to avoid multiple notifications if pidof yad >/dev/null; then @@ -123,9 +135,9 @@ set_sddm_wallpaper() { notify-send -i "$iDIR/error.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" exit 1 fi - - exec $SCRIPTSDIR/sddm_wallpaper.sh --normal - + + exec "$SCRIPTSDIR/sddm_wallpaper.sh" --normal + fi fi } |
