commit 35f8ff2

hovercats  ·  2022-02-22 23:52:51 +0000 UTC
parent 9da28b5
add rbgs.
1 files changed,  +20, -0
A rbgs
A rbgs
+20, -0
 1@@ -0,0 +1,20 @@
 2+#!/bin/sh -e
 3+
 4+# Simple script which changes your wallpaper on set amount of time.
 5+
 6+cd "$HOME"/wallpapers
 7+
 8+while :
 9+do
10+    set -- *
11+    n=$(echo $# | awk '{srand(); print int(rand()*$0) + 1}')
12+    eval "wall=\$$n"
13+    # shellcheck disable=2154
14+    bgs "$wall"
15+    sleep 300
16+done
17+
18+
19+# I wasnt sure as to how to create the random generator without using shuf,
20+# so Ive found this for reference:
21+# https://stackoverflow.com/a/6747490