Welcome
Welcome to a320

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!

Random wallpaper script for dingux

Only for posting new Dingux software releases.

Moderator: Moderators

Random wallpaper script for dingux

Postby mrLogan on Sun Aug 16, 2009 6:00 pm

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.

Code: Select all
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.
mrLogan
 
Posts: 89
Joined: Mon Aug 03, 2009 10:01 pm

Return to Dingux Releases

Who is online

Users browsing this forum: vimrc and 0 guests