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 try to run a specified command on a desired time. I found at for this, and it seems to work fine if I run:

echo "ls -al / > /home/florin/test.txt" | at 4:21am

But I want to run a different thing: /usr/bin/firefox -new-tab http://google.ro

I tried adapting the first line with my action (running it in terminal opens a new Firefox tab with http://google.ro, so the command is correct), but with at, it does not work:

echo "firefox -new-tab http://google.ro" | at 4:23am

The task seems to be scheduled, but it does not run. When running the previous line I get the default reply from at:

warning: commands will be executed using /bin/sh

Should my Firefox command be differently run in sh? Is there a way to do my action with at, or some other way?

share|improve this question
    
The question is: why would you want to do this? Could you achieve the same result using better cli-oriented tools? –  invert Nov 6 '13 at 9:48
    
You are right, it is easier with other tools. Installed gnome-schedule, it should do the trick. –  conualfy Nov 6 '13 at 13:46

1 Answer 1

The problem is that Firefox is a display oriented program requiring access to your X11 display. This information is usually available in an environment variable DISPLAY, but when you run FF from at, this is not the case. Thus FF doesn't know where to put it's graphical output and thus exits immediately.

If you're absolutely sure that you know where your display is going to be (and no pun intended, you can have any number of X11 servers running), you could just put DISPLAY with appropriate content in the beginning of your command you're feeding to at. For example, DISPLAY=0:0 firefox -new-tab http://google.ro will open a new tab on FF process runnin on first local X11 display on your computer.

share|improve this answer

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.