code / scripts

Lines748 Shell528 Python72 Lua67 Bourne Again Shell62 make15
1 others 4
Markdown4
(15 lines)
1 #!/bin/sh
2 # Pick a random wallpaper
3 wallpapers="$1"
4 if [ ! "$wallpapers" ]; then
5 wallpapers=~/wallpapers/
6 fi
7 feh -r --randomize --bg-fill "$wallpapers"
8 if test $# -gt 1; then
9 for pid in $(pidof -x randombg); do
10 if test "$pid" != $$; then
11 kill -9 "$pid"
12 fi
13 done
14 while :; do feh -r --randomize --bg-fill "$wallpapers"; sleep "$2"; done
15 fi