[ale] Launch GUI from Cron
Brian Pitts
brian at polibyte.com
Mon Sep 10 00:20:12 EDT 2007
Daniel Kahn Gillmor wrote:
> On Sun 2007-09-09 02:51:15 -0400, Brian Pitts wrote:
>
>> I created the following script
>>
>> #!/bin/sh
>> export DISPLAY=:0
>> zenity --question --text="What are you doing?"
>>
>> and added an entry for it in my crontab. Although syslog shows that it
>> runs, I never see the dialog. Any suggestions on making this work?
>
snip
>
> Is there a way you can ask zenity to provide more explicit debugging
> spew? can you have the script dump error messages to a logfile?
>
> exec 1>~/nag.log && exec 2>&1
This worked, the problem is in fact
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
(zenity:26396): Gtk-WARNING **: cannot open display:
Ran strace -f -o within cron, and the first thing that looked like a
problem was
26576 access("/home/brian/.Xauthority", R_OK) = -1 EACCES (Permission
denied)
Not surprising, since ~/.Xauthority is owned by root and has permissions
of 600. Temporarily changing ownership of this to myself didn't change
the behavior, though.
I've already written a small Ruby/Gtk app to do what I want, so I'm not
particularly motivated to solve this.
I have a new question though. Why does using exec to redirect the
shell's output work when using zenity &> ~/nag.log does not?
-Brian
More information about the Ale
mailing list