Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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 
share|improve this answer
    
Just doing the --display=:0.0 did it. Thanks! –  Ben Kraft Aug 23 '11 at 15:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.