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

Dingoo A380 Review

Mancala for Dingux released (Mandingoo was released in 1975)

Idiot’s Guide to installing Dingux using Windows released

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

How to show all your 17,083 c64 games from the c64 romset (archive.org) on the C64 Mini or C64 Maxi loader

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

Tauon PC-1 review

Dingoo representative at a320.freeforums.org !