From 01d3ac47dae36d56bf113b56c3a69d746f66a90b Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Fri, 5 Jan 2024 15:14:12 -0500 Subject: make swaybg-random friendlier --- bin/executable_swaybg-random | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/executable_swaybg-random b/bin/executable_swaybg-random index ac80495..6184e33 100644 --- a/bin/executable_swaybg-random +++ b/bin/executable_swaybg-random @@ -4,6 +4,11 @@ DIR=$1 PIDFILE=$XDG_RUNTIME_DIR/swaybg.pid +if test -z "$DIR"; then + echo "Usage: swaybg-random dir" + exit 1 +fi + swaybg -i $(find $DIR/. -type f | shuf -n1) -m fill -o \* & NEWPID=$! pkill -F $PIDFILE -- cgit v1.2.3