Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

echo "firefox -new-tab" | 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

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 will open a new tab on FF process runnin on first local X11 display on your computer.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .