[opensuse] BASH: zenity/xdialog - how to check for active X session within the script?
Bash gurus, How do I check for an active display in a bash script before calling zenity or the like to request input or provide graphical output? Do I just use the DISPLAY variable? Is there something better for a test. I want some type of test I can use like: if 'TheXTest'; then zenity blahblah else echo "blahblah" fi Any favorites? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday May 8 2010, David C. Rankin wrote:
Bash gurus,
How do I check for an active display in a bash script before calling zenity or the like to request input or provide graphical output? Do I just use the DISPLAY variable? Is there something better for a test. I want some type of test I can use like:
...
Any favorites?
All the actions of X-aware programs are directed at the display specified by the DISPLAY environment variable (at least by default), so that seems like a fine means of doing the same in your own scripts.
-- David C. Rankin
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
David C. Rankin
-
Randall R Schulz