Bash script - how to tell if in GUI or CLI?
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.