diff options
author | Ryan Kavanagh <rak@rak.ac> | 2024-01-03 09:11:52 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2024-01-03 09:12:08 -0500 |
commit | 5d90852a868c6e2f0167401f260ef88321eaa7df (patch) | |
tree | 18cc4fce0102da57c6d34d5fbd9bbc5a0e9f569a /bin | |
parent | Start emacs daemon from systemd (diff) |
randomize bg
Diffstat (limited to 'bin')
-rw-r--r-- | bin/executable_swaybg-random | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/executable_swaybg-random b/bin/executable_swaybg-random new file mode 100644 index 0000000..ac80495 --- /dev/null +++ b/bin/executable_swaybg-random @@ -0,0 +1,10 @@ +#!/bin/sh +# Usage: swaybg-random directory + +DIR=$1 +PIDFILE=$XDG_RUNTIME_DIR/swaybg.pid + +swaybg -i $(find $DIR/. -type f | shuf -n1) -m fill -o \* & +NEWPID=$! +pkill -F $PIDFILE +echo $NEWPID > $PIDFILE |