LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 04-30-2005, 01:21 PM   #1
MasterPi
Member
 
Registered: Jun 2004
Distribution: Ubuntu Breezy (5.12) and Debian Testing (Sarge)
Posts: 59

Rep: Reputation: 15
Determining the Active Virtual Console


This may be a really stupid question but does anyone know how to tell which virtual console / screen is currently being displayed on screen by a script. I'm writing a cron script to do some things when it detects a network connection but some of the things (like running evolution) depend on the DISPLAY being set. i'm currently just using "who" and awking for my username and the console, but it would be nice to know which display is actually active, since i sometimes log in on more than one.
 
Old 04-30-2005, 05:34 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Run the command: fgconsole
7 is for X
1-6 is cli
 
Old 05-02-2005, 01:39 PM   #3
MasterPi
Member
 
Registered: Jun 2004
Distribution: Ubuntu Breezy (5.12) and Debian Testing (Sarge)
Posts: 59

Original Poster
Rep: Reputation: 15
thank you! i knew it was probably something simple. one more thing: any way to determine the X display from this?
 
Old 05-02-2005, 01:51 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Do you mean something like ...
echo $DISPLAY
 
Old 05-02-2005, 04:31 PM   #5
MasterPi
Member
 
Registered: Jun 2004
Distribution: Ubuntu Breezy (5.12) and Debian Testing (Sarge)
Posts: 59

Original Poster
Rep: Reputation: 15
umm, no... if you read the first post you would see that i was trying to set DISPLAY. i was wondering if there was a way to determine which X screen was running on a given VC
 
Old 05-02-2005, 11:11 PM   #6
neo
Member
 
Registered: Apr 2005
Distribution: FreeBSD
Posts: 61

Rep: Reputation: 15
xdpyinfo | grep display
 
  


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual console Ammad Linux - Networking 2 04-05-2005 10:20 PM
Determining last login from a physical console DiscoGranny Linux - Security 2 02-03-2005 12:17 PM
determining active x window tcorreia Programming 1 08-22-2004 05:52 AM
determining active x window tcorreia Linux - General 1 08-20-2004 03:55 AM
virtual console kjsubbu Linux - Networking 0 07-23-2003 11:18 AM


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

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