[Techtalk] detecting whether started at CLI or icon
Miriam English
mim at miriam-english.org
Wed Aug 29 00:43:11 UTC 2012
Thanks Kathryn. That's the solution. I need to get the script itself to
check the tty command.
if [ `tty` = "not a tty" ]
If it returns "not a tty" then it is running from a clicked icon.
Otherwise it returns the dev name of the terminal (for example
"/dev/pts/9").
I didn't even realise there was a command to return the name of the tty.
I learn something new every day.
Cheers,
- Miriam
--
If you don't have any failures then you're not trying hard enough.
- Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
-----
Website: http://miriam-english.org
Blogs: http://miriam-e.dreamwidth.org
http://miriam-e.livejournal.com
More information about the Techtalk
mailing list