in reply to Cron in X

Set the DISPLAY environment variable to your environment. Also try xhost + (to disable the access control)

--Lakshmanan G.

The great pleasure in my life is doing what people say you cannot do.


Replies are listed 'Best First'.
Re^2: Cron in X
by MidLifeXis (Monsignor) on Sep 21, 2009 at 14:46 UTC

    While technically correct, xhost+ also opens your system up to any X client that wants to connect to your machine. How about a transparent, borderless, sticks to the top of the window stack client that does nothing but record events and pass them on to the underlying windows.

    At least use xhost +otherhostname or xhost +localhost. See this example documentation for details.

    --MidLifeXis

    Please consider supporting my wife as she walks in the 2009 Alzheimer's Walk.

Re^2: Cron in X
by irah (Pilgrim) on Sep 21, 2009 at 08:10 UTC

    I did setting DISPLAY environment variable and xhost +. It's not working.

      My guess is that your X server isn't configured to listen for TCP connections (seems to be the default on modern Linux distros), and the cron job is missing something (permissions? environment variable?) to allow it to connect over unix domain sockets. xhost + won't help in that case, you need to either re-enable the tcp listening on the X server (varies by distro, look for "-nolisten tcp" in the X11 startup args) or figure out how to get the client to use unix domain sockets successfully from the cron job.