On 07/01/11 15:19, Terry Coles wrote:
On Friday 07 Jan 2011, John Carlyle-Clarke wrote:

DISPLAY=:0.0 chromium-browser

Thanks.  That works fine.

I assume that I was right about the reason it wouldn't work in a script, eg
I'm not attached to the display in the X environment at the time?


That's pretty much it. Processes generally inherit an environment from the process that spawns them. xinit or startx or {x,k,g}dm set "DISPLAY" and other things when starting X and launching the clients (usually a window manager or similar).

This means when you start a shell in your graphical session, it inherits DISPLAY. Start a terminal in X and do "echo $DISPLAY" to check it.

If your shell script was started outside of X in some way (by cron, atd, or boot process for example) then DISPLAY will not be set.

Of course, if you have more than one X session running, or if you are running X remotely, then things may go a bit wonky since DISPLAY will need to be something else!

--
Next meeting:  Crown Hotel, Blandford Forum, Tuesday 2011-01-11 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to