Changing Hats

This blog will be used to log the changes to transition from various Linux distros.

Monday, March 20, 2006

pick a pic -- script to set random background

# pickapic: pick a random background
cd /usr/local/bin
lines=`wc -l backgrounds`
cnt=`echo $lines | awk '{print $1}'`
XX=$(( $RANDOM % $cnt ))
echo "$XX"p > /tmp/pick-line-X
cat backgrounds|sed -n -f /tmp/pick-line-X > /tmp/line-X
Esetroot -s `cat /tmp/line-X`
rm -f /tmp/line-X /tmp/pick-line-X

0 Comments:

Post a Comment

<< Home