LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-01-2006, 11:03 AM   #1
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Question Checking whether X is running at login


Hi.

I would like to be able to check whether or not X is running at login time. Namely, I'd like to be able to do something like this in ~/.bash_profile.

Code:
if [ "$X_RUNNING" = "" ]; then
    echo "X is NOT running..." > x_output.txt
else
    echo "X is running..." > x_output.txt
fi
The question is, what kind of environment variable can I use for this purpose (in place of the imaginary X_RUNNING)? Or is there another way? Any help/feedback would be appreciated.

TIA,
Dai
 
Old 12-01-2006, 11:32 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Try $DISPLAY.
 
Old 12-02-2006, 10:05 AM   #3
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by unSpawn
Try $DISPLAY.
Thanks! It is working perfectly for my purposes.

Dai
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking which services are running morrolan Ubuntu 3 01-21-2006 05:38 PM
Checking for X.....no ??? I'm running Kde!! fatrandy13 Linux - Software 5 06-01-2005 03:57 PM
Checking to See if MySQL is Running HappyDude Linux - Software 3 12-10-2004 06:52 PM
Checking what resolution X is running at pwaring Linux - Software 2 06-05-2004 02:36 PM
Checking Running Services Chijtska General 3 03-13-2002 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:23 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration