2009
11.23

so i decided to have my wallpaper in evilwm switch up every 60 seconds but since setting the wallpaper in evilwm requires the usage of feh, xv or some other utility i came up with this little script below which gets daemonized by .xinitrc at login:

#!/bin/bash

while :;do
    files=(/path/to/*.jpg /path/to/*.jpeg /path/to/*.png /path/to/*.gif)
    N=${#files[@]}
    ((N=RANDOM%N))
    randomfile=${files[$N]}
    #/usr/bin/xv -quit -root -rmode 5 $randomfile
    #/usr/bin/feh --bg-center $randomfile
    sleep 60
done

only things you have to change are the “path to’s” and you have to uncomment either the xv line, feh line or substitute your own.

you can also change the sleep interval if you want to make it shorter or longer.

The following two tabs change content below.

Latest posts by cesar (see all)

1 comment so far

Add Your Comment
  1. Super useful. Thanks!