diff options
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 7d6b339f..feae485b 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -3,8 +3,15 @@ # This script for selecting wallpapers (SUPER W) # WALLPAPERS PATH +terminal=kitty + wallDIR="$HOME/Pictures/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" +wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" + +# Directory for swaync +iDIR="$HOME/.config/swaync/images" +iDIRi="$HOME/.config/swaync/icons" # variables focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') @@ -106,4 +113,28 @@ wait $! wait $! sleep 2 -"$SCRIPTSDIR/Refresh.sh"
\ No newline at end of file +"$SCRIPTSDIR/Refresh.sh" + +sleep 3 # add delay of 3 seconds for those who have slow machines +sddm_sequoia="/usr/share/sddm/themes/sequoia_2" +if [ -d "$sddm_sequoia" ]; then + notify-send -i "$iDIR/ja.png" "Set wallpaper" "as SDDM background?" \ + -t 10000 \ + -A "yes=Yes" \ + -A "no=No" \ + -h string:x-canonical-private-synchronous:wallpaper-notify + + # Wait for user input using a background process + dbus-monitor "interface='org.freedesktop.Notifications',member='ActionInvoked'" | + while read -r line; do + if echo "$line" | grep -q "yes"; then + $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \ + sudo cp -r $wallpaper_current '$sddm_sequoia/backgrounds/default' && \ + notify-send -i '$iDIR/ja.png' 'SDDM' 'Background SET'" + break + elif echo "$line" | grep -q "no"; then + break + fi + done & +fi + |
