You are not logged in.

#1 2011-01-20 17:58:56

Cagnulein
Member
From: Modena, Italy
Registered: 2006-04-03
Posts: 260
Website

[SOLVED] Xorg Multi Session Single Monitor: where am I?

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

#2 2011-02-27 10:50:10

Karotte
Member
Registered: 2010-02-14
Posts: 3

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

ps ax | grep '/usr/bin/X' -->
... /usr/bin/X :0 vt7 ... (a)
... /usr/bin/X :1 vt8 .... (b)

Offline

#3 2011-02-27 11:17:51

Cagnulein
Member
From: Modena, Italy
Registered: 2006-04-03
Posts: 260
Website

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

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

#4 2011-02-27 13:58:41

dimitar
Member
Registered: 2011-01-27
Posts: 59

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

Cagnulein wrote:

How could you know the X on the screen is the X:0?

$ echo $DISPLAY

Hope this helps!

Dimitar

EDIT: ok, I missed the part about "user 'c' running outside the XOrg session" smile Sorry!

Last edited by dimitar (2011-02-27 14:01:08)

Offline

#5 2011-02-27 15:11:15

Cagnulein
Member
From: Modena, Italy
Registered: 2006-04-03
Posts: 260
Website

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

ehehehe no problem smile

A so simple problem, with a so hard solution...

Offline

#6 2011-02-28 10:29:08

dimitar
Member
Registered: 2011-01-27
Posts: 59

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

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

#7 2011-03-01 05:27:19

Cagnulein
Member
From: Modena, Italy
Registered: 2006-04-03
Posts: 260
Website

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

THANKS! It works like a charm!
What did you type on google to finding it?
Thank you another time smile

Offline

#8 2011-03-01 07:48:05

dimitar
Member
Registered: 2011-01-27
Posts: 59

Re: [SOLVED] Xorg Multi Session Single Monitor: where am I?

Cagnulein wrote:

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 smile

Offline

Board footer

Powered by FluxBB