tag:blogger.com,1999:blog-1619647815507301957.post2555611933872169525..comments2024-03-21T13:58:48.997+08:00Comments on Learn something new every day: Wallpaper Changer Apps For LinuxMihirhttp://www.blogger.com/profile/17917772461380151084noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1619647815507301957.post-39193813184437655492011-04-24T15:52:57.045+08:002011-04-24T15:52:57.045+08:00I found this post really helpful when looking for ...I found this post really helpful when looking for a wallpaper changer, but unfortunatly none of them worked on an out-of-the-box Lubuntu system. So I decided to develop my own, and decided on a simple command line interface. It *should* work for most configurations, but you know, can't be certain. <br /><br />Anyway, here's the link, if you're interested: http://circean-studios.co.cc/index.php?page=x-wallpaper-changer<br /><br />Stay cool :DAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1619647815507301957.post-45444137892940456912009-01-25T15:06:00.000+09:002009-01-25T15:06:00.000+09:002008Automatic Desktop Wallpaper ChangerI have a lo...2008<BR/>Automatic Desktop Wallpaper Changer<BR/>I have a lot of wallpaper that I wanted to switch automatically. After a lot of search i found that there a command way to control all the gnome settings. So I the command I used is "gconftool-2".<BR/>So code is like:<BR/><BR/>#!/bin/bash<BR/>folder="/home/rsrijith/Pics" #folder where the pics lie in<BR/>find $folder -iregex ".*.jp.?g" >$folder/temp_back #list all images in the folder<BR/>no=$(cat $folder/temp_back|wc -l)<BR/>rand=$(echo `expr $RANDOM % $no`)<BR/>while ( grep -q $rand $folder/.last50 )<BR/>do<BR/>rand=$(echo `expr $RANDOM % $no`)<BR/>done<BR/>echo $rand >> $folder/.last50<BR/>tail -50 $folder/.last50 >$folder/temp<BR/>cat $folder/temp >$folder/.last50<BR/>rm $folder/temp<BR/>file=$(sed -n $rand'p' $folder/temp_back)<BR/>ON_USER=rsrijith #your username here<BR/><BR/>export DBUS_SESSION=$(grep -v "^#" /home/$ON_USER/.dbus/session-bus/`cat /var/lib/dbus/machine-id`-0)<BR/><BR/>sudo -u $ON_USER $DBUS_SESSION /usr/bin/gconftool-2 -t string -s /desktop/gnome/background/picture_filename "$file" && echo "Worked On:"$(date) >>/home/$ON_USER/logs/desktopbackground<BR/>echo "Set Wallpaper as:"$file >>/home/$ON_USER/logs/desktopbackground<BR/>rm $folder/temp_back<BR/><BR/>I have used the DBUS_SESSION variable to make it compatible with Ubuntu 8.10. The Dbus session is a bit bit different from earlier versions. The change is that it does'nt accept the change until the gnome is restarted. It's due to the new session that is made each time you update that value.<BR/><BR/>So the folder variable should the folder where the wallpapers should lie. You can put pictures in folders inside that folder. All of it will be taken. But I have specified to take only jpg and jpeg only.Now a random image is picked from that using the environment variable $RANDOM. Next we update the gnome settings using gconftool-2 if that image was'nt used in the last 50 changes.<BR/><BR/>Thus this file picks an image and puts it as wallpaper. So the next part is making this change automatically. For this we use cron (linux scheduler).<BR/>Use the command below to enter the crontab<BR/>sudo crontab -e<BR/>Enter the crontab entry as<BR/>*/15 * * * * /home/rsrijith/shell/deskback 2>>/home/rsrijith/logs/deskbackground<BR/>Check the entry using<BR/>sudo crontab -l<BR/>That's all!!!<BR/>Anyone tried? Worked? Comment me !!! <BR/><BR/>Ref ---->http://sriunplugged.blogspot.com/2008/11/automatic-desktop-wallpaper-changer.htmlAnonymousnoreply@blogger.com