LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Random wallpapers on a timer in XFCE? (https://www.linuxquestions.org/questions/linux-desktop-74/random-wallpapers-on-a-timer-in-xfce-582377/)

AlucardZero 09-05-2007 09:42 AM

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?

rednuht 09-05-2007 02:08 PM

you have to specify the display device, try
Code:

export DISPLAY=:0 && xfdesktop --reload

AlucardZero 09-05-2007 03:18 PM

thank you!

AlucardZero 09-10-2007 09:22 AM

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."

AlucardZero 09-11-2007 11:46 AM

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.


All times are GMT -5. The time now is 07:39 AM.