Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 06-04-2010, 01:46 AM   #1
LQ Newbie
Registered: Dec 2002
Location: California, USA.
Distribution: Mint
Posts: 15

Rep: Reputation: 0
using cron to change my wallpaper

Hello, I am not understanding cron correctly. I wrote a perl script to choose a random image and use feh to set it as my wallpaper. When I run the script from the terminal it runs fine. When I added it to my crontab to run every minute it does not change the wallpaper. However, I had the script print some output and redirect it to a file, so I know cron is running the script every minute like it should.

My crontab:
My script:

I'm running Mint Linux 8 and using wmii as my window manager. I know it seems silly to worry about the wallpaper with a tiling window manager but that's just how I roll.

I'm having other problems with cron but I'll save that for later.
Old 06-04-2010, 01:58 AM   #2
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
cron jobs run with neither controlling terminal nor an X display so your script will need to tell feh which X display to use. If this is a single user workstation and the cron job is running as the usual user the solution may be as simple as setting environment variable DISPLAY to 'localhost:0.0'


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

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
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 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 > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:33 PM.

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