2 PIDFILE
=${PIDFILE:-/tmp/wallpaper.pid}
4 trap "rm -f $PIDFILE" SIGUSR1
6 # set background function (requires input)
9 # We have a single file as input
10 feh
--bg-fill --no-fehbg $1
12 elif [[ -d $1 ]]; then
15 BGIMG
=$
(find $1 -type f
-print | shuf
-n1)
16 feh
--bg-fill --no-fehbg $BGIMG
22 if [[ -f $PIDFILE ]]; then
23 # PIDFILE exists, so I guess there's already an instance running
24 # let's kill it and run again
25 kill $
(cat $PIDFILE) > /dev
/null
2>&1
34 if [[ ! -z $1 ]]; then
37 # No input. We'll use our predefined directory
38 WPAPERS
="/home/danix/Pictures/wallpapers/black"