§ Wallpaper randomiser

This will be really short - you should understand the following:

#!/bin/sh
N=`wc -l ~/System/wallpapers.txt | awk '{print $1}'`
SEED=`date +%N`
X=`expr $SEED % $N + 1`
head -n $X ~/System/wallpapers.txt | tail -n 1

I use it in my custom monitor setup script: feh --bg-fill `~/System/randwallpaper.sh`. If you want to use it like that remember that your equivalent of wallpapers.txt has to have full paths (no ~/).

I guess I should write about tailoring your own desktop environment one day, though that will be a (lot) longer article.

comments powered by Disqus
Last update: 2012-11-27. » LINK » TXT » ATOM. Go to the top. Licence CC-BY-NC-SA.
If you find this interesting go ahead and leave a comment or add a star.
Any and all feedback is appreciated!