I'm trying to use zenity and at to make a little reminder script. The problem is that while zenity --info works fine from bash (or sh), running echo "zenity --info" | at now + 1 min does nothing. The job shows up in my atq and then runs, but no zenity pop-up. What's going on?
Asked
Active
Viewed 1,244 times
1
James Mertz
- 26,224
- 41
- 111
- 163
Ben Kraft
- 335
- 2
- 8
1 Answers
2
Check your /var/log/messages, chances are you'll have some "Cannot open display" errors from your X Server.
You need to provide utilities like at and cron access to your X Display by name. Edit your ~/.bashrc to include the following:
xhost local:USERNAME > /dev/null
Substitute your username for the USERNAME value above. This will provide the at utility with the name of your X Display so it can attempt to fork zenity on it.
Modify your zenity command to include the --display switch:
echo "zenity --info --display=:0.0" | at now + 1 min
John T
- 163,373
- 27
- 341
- 348
-
Just doing the `--display=:0.0` did it. Thanks! – Ben Kraft Aug 23 '11 at 15:57