LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 12-23-2009, 04:26 AM   #31
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899

Please post the script you use., and the entry in cron
 
Old 12-23-2009, 04:30 AM   #32
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
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
put that code right after the call to gconftool-2
 
Old 12-23-2009, 05:55 AM   #33
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
Here is the output

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.
 
Old 12-23-2009, 05:58 AM   #34
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
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.
 
Old 12-23-2009, 06:00 AM   #35
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
/desktop/gnome/background/picture_filename
shouldn't that be
Quote:
/home/user/.gconf/desktop/gnome/background/picture_filename
Could you please post the whole script and the crontab entry you use?
 
Old 12-23-2009, 06:04 AM   #36
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
try to use
Quote:
* * * * * /home/lxuser/wp/change-script
Are you running the cron as user lxuser?

BTW, if there are problems with cron, it will sent a mail with the errormessages.
or look in the logfiles
 
Old 12-23-2009, 06:11 AM   #37
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
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.
 
Old 12-23-2009, 06:44 AM   #38
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
One of MANY MANY bugs in Ubuntu's?
 
Old 12-23-2009, 07:05 AM   #39
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Quote:
Originally Posted by repo View Post
shouldn't that be
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:
Code:
export HOME=/home/myuser

Last edited by Agrouf; 12-23-2009 at 07:07 AM.
 
Old 12-23-2009, 07:07 AM   #40
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Hi,

Take a look at
http://www.pubbs.net/gnome/200910/3988/
 
Old 12-23-2009, 07:14 AM   #41
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Quote:
Originally Posted by DrLove73 View Post
One of MANY MANY bugs in Ubuntu's?
I am pretty sure it is not a bug and more likely linked to the environment variables that are not set when running from cron.
 
Old 12-23-2009, 07:26 AM   #42
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Originally Posted by DrLove73 View Post
One of MANY MANY bugs in Ubuntu's?
Its a problem with GNOME, not ubuntu or whatever distro you use
see
http://www.pubbs.net/gnome/200910/3988/
 
Old 12-23-2009, 07:42 AM   #43
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Quote:
Originally Posted by repo View Post
Its a problem with GNOME, not ubuntu or whatever distro you use
see
http://www.pubbs.net/gnome/200910/3988/
I've read the link and I still believe it is an environment problem.
To test it, I suggest doing that:
Code:
env | sed "s/^/export /g" | sed "s/=/=\"/" | sed "s/$/\"/g"  >/tmp/env.sh
chmod a+x /tmp/env.sh
and adding that at the beginning of the script:
Code:
. /tmp/env.sh

Last edited by Agrouf; 12-23-2009 at 07:46 AM.
 
Old 12-28-2009, 11:17 PM   #44
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
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.
 
Old 12-29-2009, 05:26 AM   #45
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Edit: duplicate post

Last edited by Agrouf; 12-29-2009 at 05:31 AM.
 
  


Reply

Tags
software, wallpaper



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't change wallpaper w/ openbox / how to change mousespeed johnnyxxxcakes Linux - Newbie 14 05-24-2009 07:11 PM
change wallpaper? matrixon Linux - Software 1 06-12-2006 03:20 AM
Wallpaper Won't change Rick069 Linux - Newbie 3 04-16-2006 01:03 PM
How to change wallpaper pacranch Amigo 9 06-27-2005 01:30 PM
change wallpaper TravisB Linux - General 4 10-23-2002 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration