From d3fe12617fbbf8c452f16d03672726a9a403297b Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 22 Mar 2026 17:51:44 +0100 Subject: Fix theming wallpaper persistence --- roles/hyprland/templates/hypr/autostart.conf.j2 | 2 +- roles/hyprtheme/files/scripts/wallpaper.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/hyprland/templates/hypr/autostart.conf.j2 b/roles/hyprland/templates/hypr/autostart.conf.j2 index 36ecf73c..ec06c627 100644 --- a/roles/hyprland/templates/hypr/autostart.conf.j2 +++ b/roles/hyprland/templates/hypr/autostart.conf.j2 @@ -3,6 +3,6 @@ exec-once = uwsm-app -- hypridle exec-once = uwsm-app -- mako exec-once = uwsm-app -- waybar -exec-once = uwsm-app -- swaybg -i ~/.config/hyprtheme/current/background -m fill +exec-once = uwsm-app -- swaybg -i ~/.config/hyprtheme/current/wallpaper -m fill exec-once = uwsm-app -- clipse -listen exec-once = uwsm app -- hyprsunset diff --git a/roles/hyprtheme/files/scripts/wallpaper.sh b/roles/hyprtheme/files/scripts/wallpaper.sh index 35654b94..4a1f61b2 100755 --- a/roles/hyprtheme/files/scripts/wallpaper.sh +++ b/roles/hyprtheme/files/scripts/wallpaper.sh @@ -25,6 +25,8 @@ show_wallpapers() { } select_wallpaper() { + local wallpaper_link="$HOME/.config/hyprtheme/current/wallpaper" + local selected_wallpaper="$1" if [[ ! -f "$selected_wallpaper" ]]; then notify-send -e \ @@ -37,8 +39,9 @@ select_wallpaper() { exit 0 fi + ln -nsf "$selected_wallpaper" "$wallpaper_link" pkill -x swaybg - setsid uwsm-app -- swaybg -i "$selected_wallpaper" -m fill >/dev/null 2>&1 & + setsid uwsm-app -- swaybg -i "$wallpaper_link" -m fill >/dev/null 2>&1 & } if [[ -z "$1" ]]; then -- cgit v1.2.3