jason . stelzer on 27 Jan 2010 06:14:34 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Detecting X Windows in a shell script


Using xhost is very insecure. If you're on a single user box, localhost is fine, but it's still a bad habit to get into. See also http://tldp.org/HOWTO/Remote-X-Apps-6.html


As for detecting X, the simplest way is to just check if $DISPLAY is set.

A potentially more correct way to do this would be via your X startup script since xhost only needs to be executed once after X is started. I'd probably just throw the command in my .xsession file if I were going to do that. X11 configuration/management doesn't really have much to do with bash setup/configuration. The details of where to add the command depend heavily on how you start your X session. I tend to use .xsession scripts. Gnome has some settings you can use so that programs auto start when you log in to a new session. You could always use that too.

--
J.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug