Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Also, check that the gconftool-2 command is indeed executed and with which arguments.
You can do that with the echo command redirected to a file.
Code:
echo "I execute the gconftool-2 command with arguments: --type string --set /desktop/gnome/background/picture_filename $pictdir/${fnme[${i}]}" >/tmp/myscript.log
I execute the gconftool-2 command with arguments: --type string --set /desktop/gnome/background/picture_filename /home/lxuser/wp/1.jpg at Wed Dec 23 17:18:01 IST 2009
Please Note the variable was wp_fn so I used $wp_fn in double quotes & also added `date` to expression in double quotes.
the annoying thing is when I check string using
gconf-editor or gcontool-2 then value has not changed & equals default.
Last edited by sumeet inani; 12-23-2009 at 05:56 AM.
Here is the script for all ubuntu GNOME users to change wallpaper every 5 minutes ( tested in ubuntu 8.04 ).
All you have to do is copy desired wallpaper(jpg format) to `/Pictures & rename then as 0,1,2...
Code:
#!/bin/bash
if [ -e ~/Pictures/.int.txt ]; then
echo 0 > /dev/null
else
echo 0 > ~/Pictures/.int.txt
fi
i=`head ~/Pictures/.int.txt` #get the content of the file
#if greater than 18, then sets back i to 0.
if [ $i -gt 18 ]; then
let i=0
fi
wp_fn=~/Pictures/$i.jpg #set the name of the wallpaper file
gconftool-2 -t str -s /desktop/gnome/background/picture_filename $wp_fn
#after finished, increment the value of i
let i=i+1;
echo "$i" > ~/Pictures/.int.txt
Save above file as script in ~/Pictures,
Make it executable using 'chmod +x ~/Pictures/script'
Add following entry to cron using 'crontab -e'
*/5 * * * * ~/Pictures/script
You can verify by 'crontab -l'
This will change wallpaper every 5 minutes.
NOTE
You can remove extension from all wallpaper files & also remove .jpg from script then you can use any image format ( tested with png ).
If you find this post useful then thank me by pressing thumbs up button.Thank You.
Last edited by sumeet inani; 12-29-2009 at 08:02 AM.
Done but no effect.
Is it possible that desktop wallpaper is locked.
Also ran
mail
But got no message
I also found that
/home/lxuser/.gconf/desktop/gnome/background/%gconf.xml
is also changing as desired but screen does not refresh.Why ?
Last edited by sumeet inani; 12-23-2009 at 06:19 AM.
No, it's a gconf entry, not a filename.
sumeet inani:
I saw you use /home/path instead of exporting $HOME as I suggested.
You should not. gconftool-2 uses $HOME/.gconf and if $HOME is not set, it won't work.
DO use that code at the start of your script:
As i have said that even if I mention full address without using ~ or $HOME etc. then also wallpaper does not change in ubuntu 9.04 though it does in ubuntu 8.04.
So I think repo is right.
I will also modify script a little bit in previous post so that atleast ubuntu 8.04 users can store all their wallpaper files numbered 0.jpg,1.jpg,.. and script in ~/Pictures.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.