You are not logged in.
Scenario:
- 1 monitor
- 2 XOrg session (one for user 'a' and another one for user 'b')
With CTRL-ALT-F7 and CTRL-ALT-F8 I can switch between these 2 virtual sessions.
But how can I know which session is on the screen? (and so which one is on background?)
I need this information inside a little daemon running as user 'c' outside XOrg sessions
Thanks
Roberto
Last edited by Cagnulein (2011-03-01 05:27:41)
Offline
ps ax | grep '/usr/bin/X' -->
... /usr/bin/X :0 vt7 ... (a)
... /usr/bin/X :1 vt8 .... (b)
Offline
it doesn't solve my problem: assume you're on X:0, how could you know it? How could you know the X on the screen is the X:0?
Offline
How could you know the X on the screen is the X:0?
$ echo $DISPLAYHope this helps!
Dimitar
EDIT: ok, I missed the part about "user 'c' running outside the XOrg session"
Sorry!
Last edited by dimitar (2011-02-27 14:01:08)
Offline
ehehehe no problem ![]()
A so simple problem, with a so hard solution...
Offline
Hi Cagnulein,
check fgconsole: it reports the number of the virtual console which is currently in the foreground. It does not report exactly which X session is active, but I suppose you could find somehow that given the vt number.
Kudos go to stackoverflow: http://stackoverflow.com/questions/3034 … l-terminal
Dimitar
Offline
THANKS! It works like a charm!
What did you type on google to finding it?
Thank you another time ![]()
Offline
What did you type on google to finding it?
Well, I thought, that not the X session is important, but rather the virtual terminal, so I searched for "how to check which virtual terminal vt is currently displayed" and the fourth link was the stackoverflow link ![]()
Offline