LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Bash script - how to tell if in GUI or CLI? (http://www.linuxquestions.org/questions/programming-9/bash-script-how-to-tell-if-in-gui-or-cli-384551/)

dive 11-19-2005 01:30 AM

Bash script - how to tell if in GUI or CLI?
 
Hi
I've a handy program called pop3check that checks my email once an hour. What I want to do is run a small script when I have mail that -

If in GUI runs a kdialog box, or
If in CLI plays a notify sound and echos to terminal

So how can I tell from a script what runlevel I'm in? This is in Slackware.

TIA

spooon 11-19-2005 02:08 AM

you can check whether the $DISPLAY variable is set

dive 11-19-2005 02:12 AM

Thanks, that's exactly what I'm after :)


All times are GMT -5. The time now is 10:32 AM.