[opensuse] OpenSUSE 11.1 cron job access to X display
I have just upgraded from openSUSE 11.0 to 11.1. I use XFCE as desktop and I have a cron job that change my background every hour by executing xfdesktop -reload. This worked fine until now. On openSUSE 11.1, the script cannot access the display. I get the error: (xfdesktop:14628): Gtk-WARNING **: cannot open display: :0 It works fine if I run it from an x terminal. Any idea hos I can give the cron job access to the display, or any other ideas on how to run a script every hour inside the X session? Thanks -- Andre Truter | Software Consultant | Registered Linux user #185282 Jabber: andre.truter@gmail.com | http://www.trusoft.co.za ~ A dinosaur is a salamander designed to Mil Spec ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/2/21 Andre Truter <andre.truter@gmail.com>:
I have just upgraded from openSUSE 11.0 to 11.1. I use XFCE as desktop and I have a cron job that change my background every hour by executing xfdesktop -reload. This worked fine until now. On openSUSE 11.1, the script cannot access the display. I get the error:
(xfdesktop:14628): Gtk-WARNING **: cannot open display: :0
It works fine if I run it from an x terminal.
Any idea hos I can give the cron job access to the display, or any other ideas on how to run a script every hour inside the X session?
Thanks
-- Andre Truter | Software Consultant | Registered Linux user #185282 Jabber: andre.truter@gmail.com | http://www.trusoft.co.za
~ A dinosaur is a salamander designed to Mil Spec ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
What about defining DISPLAY before running the command? Something like: ------ 0 * * * * export DISPLAY=localhost:0.0; /usr/bin/xfdesktop -reload ------ Regards, -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/2/22 Ciro Iriarte <cyruspy@gmail.com>:
2009/2/21 Andre Truter <andre.truter@gmail.com>:
I have just upgraded from openSUSE 11.0 to 11.1. I use XFCE as desktop and I have a cron job that change my background every hour by executing xfdesktop -reload. This worked fine until now. On openSUSE 11.1, the script cannot access the display. I get the error:
(xfdesktop:14628): Gtk-WARNING **: cannot open display: :0
It works fine if I run it from an x terminal.
Any idea hos I can give the cron job access to the display, or any other ideas on how to run a script every hour inside the X session?
Thanks
-- Andre Truter | Software Consultant | Registered Linux user #185282 Jabber: andre.truter@gmail.com | http://www.trusoft.co.za
~ A dinosaur is a salamander designed to Mil Spec ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
What about defining DISPLAY before running the command?
Something like:
------ 0 * * * * export DISPLAY=localhost:0.0; /usr/bin/xfdesktop -reload ------
Regards,
-- Ciro Iriarte http://cyruspy.wordpress.com --
You can also send the USR1 to the xfdesktop, that will force the wallpaper reload apparently. That way you don't need to bother with the DISPLAY variable... Ref: http://rubylution.ping.de/articles/2007/08/31/automatically-changing-backgro... Regards, -- Ciro Iriarte http://cyruspy.wordpress.com -- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ciro Iriarte wrote: [ ... ]
(xfdesktop:14628): Gtk-WARNING **: cannot open display: :0
It works fine if I run it from an x terminal.
What about defining DISPLAY before running the command?
Well, the error message suggests DISPLAY is set. I'd suspect XAUTHORITY as the culprit, try defining that before running the script... Pit -- Dr. Peter "Pit" Suetterlin http://www.astro.su.se/~pit Institute for Solar Physics Tel.: +34 922 405 590 (Spain) P.Suetterlin@royac.iac.es +46 8 5537 8507 (Sweden) Peter.Suetterlin@astro.su.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
2009/2/22 Pit Suetterlin <P.Suetterlin@royac.iac.es>:
Ciro Iriarte wrote: [ ... ]
(xfdesktop:14628): Gtk-WARNING **: cannot open display: :0
It works fine if I run it from an x terminal.
What about defining DISPLAY before running the command?
Well, the error message suggests DISPLAY is set.
Yes, I am already setting the DISPLAY variable in my script
I'd suspect XAUTHORITY as the culprit, try defining that before running the script...
Yes, it seems to be the XAUTHORITY variable that is the problem. Up to openSUSE 11.0 it was set at the default $HOME/.Xauthority, but now it seems to be random for each XServer start. At the moment it is /var/run/gdm/auth-for-andre-6BxCA5/database But even if I set XAUTHORITY and export it in the script, it does not work. But Ciro's suggestion works: killall -USR1 xfdesktop Thanks -- Andre Truter | Software Consultant | Registered Linux user #185282 Jabber: andre.truter@gmail.com | http://www.trusoft.co.za ~ A dinosaur is a salamander designed to Mil Spec ~ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Andre Truter
-
Ciro Iriarte
-
Pit Suetterlin