View Single Post
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1074
Wallpaper auto-changer by Coderus and use it with idle profile

1. Put your wallpapers to /home/user/.wallpapers
2. Put script to /home/user/MyDocs
3. Choose the Idle profile for some minutes that you want.
4. Run it in "Custom action" as ROOT:
Code:
sh -c "echo rootme | devel-su -c 'sh /home/user/MyDocs/auto-wall.sh'"
rootme = your root password

Code:
#!/bin/sh

tmpFile=$(mktemp)
wallpapers="/home/user/.wallpapers"

files=$(find $wallpapers -type f > $tmpFile)
total=$(cat "$tmpFile"|wc -l)
randomNumber=$(($RANDOM%$total))

i=0
while read line;  do
  if [ "$i" -eq "$randomNumber" ];then
    # Do stuff with file
    gconftool-2 -t string -s /desktop/meego/background/portrait/picture_filename "$line"
    break
  fi
  let i="$i+1"
done < $tmpFile
rm $tmpFile
Thanks to Coderus for script.

Last edited by Schturman; 2013-02-13 at 17:47.
 

The Following 5 Users Say Thank You to Schturman For This Useful Post: