From 4de5a217c25fe83bb54063f8d842b78c9e6d7fb3 Mon Sep 17 00:00:00 2001 From: "eric.marin" Date: Thu, 26 Dec 2024 14:33:06 +0100 Subject: wallust --- scripts/set_random | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/set_random (limited to 'scripts/set_random') diff --git a/scripts/set_random b/scripts/set_random new file mode 100755 index 0000000..cdc4018 --- /dev/null +++ b/scripts/set_random @@ -0,0 +1,14 @@ +#!/usr/bin/fish + +if test (count $argv) -lt 1; or not test -d $argv[1] + echo "Usage: $(status filename) " + exit 1 +end + +~/.config/scripts/set_background ( + for file in (find $argv[1] -type f) + if test -z $img; or test $file != $img + echo (math (random) % 1000)":$file" + end + end | sort -n | head -n 1 | cut -d ':' -f2) + -- cgit v1.2.3