From 5d90852a868c6e2f0167401f260ef88321eaa7df Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Wed, 3 Jan 2024 09:11:52 -0500 Subject: randomize bg --- bin/executable_swaybg-random | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 bin/executable_swaybg-random (limited to 'bin/executable_swaybg-random') 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 -- cgit v1.2.3