aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorDonald Williams <129223418+dwilliam62@users.noreply.github.com>2025-09-22 16:28:38 -0400
committerGitHub <noreply@github.com>2025-09-22 16:28:38 -0400
commitb4e0fda59b10440006b0a7bea5d8c0419d016eb0 (patch)
treeba08440de4ce27079cf70644ddc9f8d98f6776ff /config/hypr/scripts
parentce072686ca7e143032b0cb1b29ee7cea34a87541 (diff)
parent58e1933d499436544ae1231f7b6686b80dacbff3 (diff)
Merge pull request #819 from JaKooLit/feat/sddm-wallpaper-default-path-detection
fix(sddm): set Backgrounds/default as primary and update fallbacks;
Diffstat (limited to 'config/hypr/scripts')
-rw-r--r--config/hypr/scripts/sddm_wallpaper.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh
index a781156e..9487188c 100644
--- a/config/hypr/scripts/sddm_wallpaper.sh
+++ b/config/hypr/scripts/sddm_wallpaper.sh
@@ -10,7 +10,12 @@ wallDIR="$HOME/Pictures/wallpapers"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified"
-sddm_simple="/usr/share/sddm/themes/simple_sddm_2"
+# Resolve SDDM themes directory (standard paths and NixOS path)
+sddm_themes_dir="/usr/share/sddm/themes"
+if [ ! -d "$sddm_themes_dir" ] && [ -d "/run/current-system/sw/share/sddm/themes" ]; then
+ sddm_themes_dir="/run/current-system/sw/share/sddm/themes"
+fi
+sddm_simple="$sddm_themes_dir/simple_sddm_2"
# rofi-wallust-sddm colors path
rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi"
@@ -46,6 +51,12 @@ else
wallpaper_path="$wallpaper_modified"
fi
+# Abort on NixOS where this repo doesn't manage SDDM and themes are typically read-only
+if hostnamectl 2>/dev/null | grep -q 'Operating System: NixOS'; then
+ notify-send -i "$iDIR/error.png" "SDDM" "NixOS detected: skipping SDDM background change."
+ exit 0
+fi
+
# Launch terminal and apply changes
$terminal -e bash -c "
echo 'Enter your password to update SDDM wallpapers and colors';
@@ -70,7 +81,15 @@ sudo sed -i \"s/UserIconColor=\\\"#.*\\\"/UserIconColor=\\\"$color7\\\"/\" \"$sd
sudo sed -i \"s/PasswordIconColor=\\\"#.*\\\"/PasswordIconColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\"
# Copy wallpaper to SDDM theme
-sudo cp \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\"
+# Primary: set Backgrounds/default (no extension) for simple_sddm_2
+sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\" || true
+# Fallbacks: if theme ships default.jpg or default.png, update those too
+if [ -e \"$sddm_simple/Backgrounds/default.jpg\" ]; then
+ sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default.jpg\"
+fi
+if [ -e \"$sddm_simple/Backgrounds/default.png\" ]; then
+ sudo cp -f \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default.png\"
+fi
notify-send -i \"$iDIR/ja.png\" \"SDDM\" \"Background SET\"
" \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage