From 2781082f1085757a0cfb929ba37de968726ec751 Mon Sep 17 00:00:00 2001 From: "eric.marin" Date: Tue, 2 Dec 2025 08:54:27 +0100 Subject: xd --- scripts/set_background | 19 ++++++++----------- scripts/set_random | 4 ++-- scripts/wallpapermenu | 20 ++++++++++++-------- 3 files changed, 22 insertions(+), 21 deletions(-) (limited to 'scripts') diff --git a/scripts/set_background b/scripts/set_background index 9a29ffa..be75486 100755 --- a/scripts/set_background +++ b/scripts/set_background @@ -1,21 +1,18 @@ #!/usr/bin/fish - if test (count $argv) -lt 1; or not test -f $argv[1] echo "Usage: $(status filename) " exit 1 end -set -x SWWW_TRANSITION "any" -set -x SWWW_TRANSITION_FPS 60 -set -x SWWW_TRANSITION_DURATION 1.5 - -niri msg action do-screen-transition -wallust run $argv[1]; and begin - set -U img $argv[1] - swww img $argv[1] +wallust run $argv[1] -Ts; and begin + set -U IMG $argv[1] + echo "IMG=$IMG" > ~/.config/scripts/IMG.env + niri msg action do-screen-transition + wallust -q run $IMG + systemctl --user restart swaybg.service makoctl reload - notify-send -i $img "Wallust" "Changed wallpaper and palette." + notify-send -i $IMG "Wallust" "Changed wallpaper and palette." end; or begin - notify-send -u critical "Wallust" "Failed to change palette" + notify-send -i $argv[1] -u critical "Wallust" "Failed to change palette" end; diff --git a/scripts/set_random b/scripts/set_random index cdc4018..894361c 100755 --- a/scripts/set_random +++ b/scripts/set_random @@ -6,8 +6,8 @@ if test (count $argv) -lt 1; or not test -d $argv[1] end ~/.config/scripts/set_background ( - for file in (find $argv[1] -type f) - if test -z $img; or test $file != $img + for file in (fd . $argv[1] -t f) + if test -z $IMG; or test $file != $IMG echo (math (random) % 1000)":$file" end end | sort -n | head -n 1 | cut -d ':' -f2) diff --git a/scripts/wallpapermenu b/scripts/wallpapermenu index c90ff7c..85ed1d1 100755 --- a/scripts/wallpapermenu +++ b/scripts/wallpapermenu @@ -1,11 +1,15 @@ #!/usr/bin/fish -set dir "$HOME/Pictures/Backgrounds/" -set chosen ( - for file in (find $dir -type f) - if test -z $img; or test $file != $img - echo -en "$file\0icon\x1fthumbnail://$file\n" - end - end | rofi -dmenu -p " " -show-icons -theme ~/.config/rofi/wallpapermenu.rasi) +if test -z $argv[1] + echo "Provide a directory" +else + set dir $argv[1] + set chosen ( + for file in (find $dir -type f) + if test -z $IMG; or test $file != $IMG + echo -en "$file\0icon\x1fthumbnail://$file\n" + end + end | rofi -dmenu -p " " -show-icons -theme ~/.config/rofi/wallpapermenu.rasi) -~/.config/scripts/set_background (echo $chosen) + ~/.config/scripts/set_background (echo $chosen) +end -- cgit v1.2.3