LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-05-2007, 09:42 AM   #1
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Random wallpapers on a timer in XFCE?


Hi,

On Debian Lenny and XFCE 4.4.1 I would like to change my wallpaper, say daily. I gave XFCE a list of wallpapers to use, and it gives me a random one every time I log in, or when I run xfdesktop --reload. But if I try to run that command in a cron job or on a tty (basically, on any command line that's not running in the X server), it says it cannot open the display. This is on my laptop, which I hibernate normally.

So my question is how can I get a random desktop daily?
 
Old 09-05-2007, 02:08 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 31
you have to specify the display device, try
Code:
export DISPLAY=:0 && xfdesktop --reload
 
Old 09-05-2007, 03:18 PM   #3
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
thank you!
 
Old 09-10-2007, 09:22 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Code:
From: Anacron <root@thrawn>
To: root@thrawn
Subject: Anacron job 'cron.daily' on thrawn
Date: Fri, 07 Sep 2007 11:18:25 -0400

/etc/cron.daily/wallpaper:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(xfdesktop:6725): Gtk-WARNING **: cannot open display:  
run-parts: /etc/cron.daily/wallpaper exited with return code 1
??

If I just run /etc/cron.daily/wallpaper from a TTY, as my normal user, it works..


Edit: So I guess root can't change alucard's wallpaper? I tried the command "# sudo -u alucard blah blah" but got the same "cannot open display."

Last edited by AlucardZero; 09-11-2007 at 11:23 AM.
 
Old 09-11-2007, 11:46 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Original Poster
Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
This looks promising:

Code:
/etc/cron.daily/wallpaper: 
#!/bin/sh
killall -USR1 xfdesktop
This can be run as root from anywhere, and doesn't require you to have a DISPLAY or to be the normal user.

I'll tell you tomorrow or the next day if it works.
 
  


Reply



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
using /dev/random to output random numbers on a text file guguma Programming 4 04-02-2007 01:42 PM
Multimedia timer (SMP friendly timer) bigqueso Linux - Kernel 0 03-15-2007 03:49 PM
KDE Random wallpaper or script to create symbolic links to random files cvelasquez Linux - Software 2 02-26-2007 06:48 PM
Creating random numbers from shell with /dev/random khermans Linux - General 1 07-13-2004 12:12 PM
random wallpapers in XFCE astroboiii Linux - Software 0 02-12-2004 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:22 AM.

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