mrlogan’s random wallpaper script

mrlogan has posted this great little script on the A320 freeforums:

I like my wallpapers randomized but I had trouble trying to store the file names in an array so I came up with an alternative script. I thought I would include it in case anyone has been looking for one.

cd /usr/local/dmenu/wallpaper
#change the above line to where ever you store your wallpaper
COUNT=`ls *.png -l | wc -l`
FILES=`ls *.png`
let SELECT=$RANDOM%$COUNT
echo "Selecting File Index " $SELECT "From " $COUNT "Files"
ctr0=0
for F in $FILES; do
  if [ $ctr0 -eq $SELECT ]; then
    RANDOMFILE=$F
    echo "found it!"
  fi
  let ctr0=$ctr0+1
done
echo "File selected is " $RANDOMFILE
#change this line below to point to where ever your default wallpaper is
cp $RANDOMFILE wallpaper.png


I put mine in a file (like random.sh) and execute it the main script in the sbin folder before it loads the menu up.

Comments

Popular posts from this blog

Idiot’s Guide to installing Dingux using Windows released

Dingoo A380 Review

The Dingoo-Scene JXD S7800B (Rockchip 3188 SoC) Android Gaming Console Review

An interview with the creator of the Tauon PC-1, Volodymyr Mishin

Tauon PC-1 review

Mancala for Dingux released (Mandingoo was released in 1975)

Dingoo representative at a320.freeforums.org !

What those included Interesting Games REALLY are