#!/bin/sh # Pick a random wallpaper wallpapers="$1" if [ ! "$wallpapers" ]; then wallpapers=~/wallpapers/ fi feh -r --randomize --bg-fill "$wallpapers" if test $# -gt 1; then for pid in $(pidof -x randombg); do if test "$pid" != $$; then kill -9 "$pid" fi done while :; do feh -r --randomize --bg-fill "$wallpapers"; sleep "$2"; done fi