LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-19-2005, 01:30 AM   #1
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
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
 
Old 11-19-2005, 02:08 AM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
you can check whether the $DISPLAY variable is set
 
Old 11-19-2005, 02:12 AM   #3
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Original Poster
Rep: Reputation: 292Reputation: 292Reputation: 292
Thanks, that's exactly what I'm after
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
boot CLI vs GUI weazy Linux - Software 2 08-04-2006 09:15 PM
Suse 8.2 Boots to CLI not to GUI porkchopexpress Linux - Newbie 5 06-22-2005 08:27 AM
changing gui from cli twistedrhymes Linux - Newbie 3 06-14-2005 02:44 AM
Microsoft's CLI: Is it a Bash Clone? ernesto_cgf Linux - News 3 06-13-2005 01:39 AM
can only change network with GUI, not CLI learnfast Linux - Newbie 2 05-03-2005 06:30 AM


All times are GMT -5. The time now is 05:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration