aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorericmarin <maarin.eric@gmail.com>2026-04-29 21:12:05 +0200
committerericmarin <maarin.eric@gmail.com>2026-07-27 15:55:03 +0200
commit5a75ed84af8e58db80f3687e8f5237dee9876485 (patch)
tree6b2fba6a3d5cb34ff647499185e12887658df24f /scripts
parent4373c2db3d54802735105bc3ca602214d94b9f16 (diff)
downloaddotfiles-master.tar.gz
dotfiles-master.zip
changed wallpapermenu scriptHEADmaster
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/set_random7
-rwxr-xr-xscripts/wallpapermenu10
2 files changed, 4 insertions, 13 deletions
diff --git a/scripts/set_random b/scripts/set_random
index 52dbab4..6c4a76d 100755
--- a/scripts/set_random
+++ b/scripts/set_random
@@ -5,9 +5,4 @@ if test (count $argv) -lt 1; or not test -d $argv[1]
exit 1
end
-~/.config/scripts/set_background (
- for file in (fd . $argv[1] -t f -d 1)
- if test -z $IMG; or test $file != $IMG
- echo (math (random) % 1000)":$file"
- end
- end | sort -n | head -n 1 | cut -d ':' -f2)
+~/.config/scripts/set_background "$(fd -a -t f -d 1 -E "$(basename "$IMG")" -e jpg -e png -e webp . "$argv[1]" | shuf -n1)"
diff --git a/scripts/wallpapermenu b/scripts/wallpapermenu
index 1ddf308..b60c646 100755
--- a/scripts/wallpapermenu
+++ b/scripts/wallpapermenu
@@ -3,12 +3,8 @@
if test -z $argv[1]
echo "Provide a directory"
else
- set chosen (
- for file in (fd . $argv[1] -t f -d 1)
- if test -z $IMG; or test $file != $IMG
- echo -en "$file\0icon\x1fthumbnail://$file\n"
- end
+ ~/.config/scripts/set_background (
+ for file in (fd -a -t f -d 1 -E "$(basename "$IMG")" -e jpg -e png -e webp . "$argv[1]")
+ echo -en "$file\0icon\x1fthumbnail://$file\n"
end | rofi -dmenu -p " " -show-icons -theme ~/.config/rofi/wallpapermenu.rasi)
-
- ~/.config/scripts/set_background (echo $chosen)
end