LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 04-27-2005, 09:42 PM   #1
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Rep: Reputation: 15
Question Wallpaper swicher


I just downloaded a boatload of Tux wallpapers and I was wondering if there was a program that would switch the wallpaper every X minutes.
I was thinking it might be done in with a cron job but as a linux noob I wouldn't know where to start.
My window manager is XFCE 4.2.0 and my distro is Slackware 10.1, thank you.
 
Old 04-27-2005, 10:25 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
I use this, you should change Esetroot to the program you use to set backgrounds (like fbsetbg), also the wallpaper directory and the time.

Code:
#!/bin/bash
while [ 1 ]; do
	FILELIST=`ls $HOME/multimedia/wallpapers/* | wc | awk '{print $1}'`
	let REM=$RANDOM%$FILELIST
	if [ $REM -lt 1 ]; then
		REM=1
	fi
	WALLPAPER=`ls -1 $HOME/multimedia/wallpapers/* | awk -v THIS=$REM '{ if ( NR == THIS ) print $0 }'`
	Esetroot -scale $WALLPAPER
	sleep 600
done

Last edited by gbonvehi; 04-27-2005 at 10:29 PM.
 
Old 04-27-2005, 11:09 PM   #3
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
I started reading the XFCE manual and found out that you open up the "Desktop Settings" and under "Image" you select "New List..." you can make a list of backgrounds. Then you can run "xfdesktop -reload" it will pick a random background from the list.
So now I need to know how I can run that command every X minutes (without having to start a bash script every time I login)
 
Old 04-27-2005, 11:53 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
With the command:
Code:
crontab -e
you start editing crontab, basically you'll need to put:
Code:
*/12 * * * *  xfdesktop -reload
Or put that line in a file and run: crontab file

PS: Running the script everytime you login is basically the same crontab does (my script sleeps 10 minutes so it changes background every ten minutes).. but well.. you want to use crontab
 
Old 04-28-2005, 10:41 AM   #5
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
I put that in there but nothing happens.

bash-3.00$ ps ax | grep cron
2599 ? S 0:00 /usr/sbin/crond -l10

I've searched around the net a little bit and I see references to /usr/lib/cron/cron.allow but the file does not exist.
 
Old 04-28-2005, 04:55 PM   #6
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
I've added "*/12 * * * * xfdesktop -reload" in my crontab file using "crontab -e" and cron is running (see above) but nothing is happening.
What Am I missing? Do I need to put my self in the crontabs allow list, if so where is it at?
 
Old 04-29-2005, 01:12 PM   #7
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
When I login I can use su to become root and then type crond and it will work, but if crond is already running (above 2 posts) why is it not working?!?
 
Old 04-29-2005, 01:56 PM   #8
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Did you try using xfdesktop with full path, maybe crontab doesn't load all enviroment values when running commands.
I've checked if crontab -e added the command to my running cron daemon within my user and it does.
 
Old 04-29-2005, 04:45 PM   #9
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
I tried but I still have to start crond manually. Could it be that its launched with "-l10" at the start?
 
Old 04-29-2005, 05:49 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Add this line to crontab -e: */12 * * * * echo "testing" > /home/youruser/crontest
If you wait 10 minutes and see a file called crontest in your home directory then the problem is xfdesktop, maybe you need to call it differently.
Oh, and when you add that command, take a look as root (others users can't) at /var/spool/cron/crontabs/ there you should see a file that has your user name and if you open it it has the crontab commands (adding the command there won't work).
crond -l10 makes crontab to be more verbose when showing errors, you can see that in it's man page.

PS: Are you saving the file when using crontab -e right? I don't want to offend, sometimes it happens

Last edited by gbonvehi; 04-29-2005 at 05:53 PM.
 
Old 04-29-2005, 07:42 PM   #11
Kruncher
Member
 
Registered: Mar 2005
Distribution: Ubuntu
Posts: 61

Original Poster
Rep: Reputation: 15
I added the echo testing thing and it created the file.
yes I can see /var/spool/cron/crontabs/<username> and yes im saving it with "crontab -e"
It's really weird tho, if I put in "/usr/bin/xfdesktop -relaod" or "xfdesktop -reload" it wont work unless I manually start crond, why is that?

Last edited by Kruncher; 04-29-2005 at 10:33 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
where i can get this wallpaper? bambeklis General 5 08-20-2005 02:39 PM
Looking for a certain wallpaper. Can you help? blueCow General 2 12-04-2004 09:30 PM
Wallpaper: SLide show wallpaper from online pictures eponymous Linux - Software 0 11-29-2004 01:28 PM
Where exactly is the wallpaper? LinuxSeeker Suse/Novell 6 11-07-2004 01:34 AM
Wallpaper King4lex General 1 09-02-2004 04:21 PM


All times are GMT -5. The time now is 04:35 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration