[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to detect which user is connected to $DISPLAY

Am 2005-03-27 07:31:09, schrieb sean finney:

> get_desktop_owner () 
> { 
> 	owner_display=$1;
> 	w | awk '{print $1" "$2}' | grep "$owner_display$" | awk '{print $1}'
> }
> example:
> copelandia[~]07:29:50$ get_desktop_owner :0
> seanius
> i invite someone to invent a better way, i'd like to hear it :)

It works in SARGE and SID but not under WOODY because I get only

user    /dev/pts/1      <time>

without $DISPLAY. The test I must use, should work under WOODY too.

I have an documentation Serve at home, where I have installed ALL
manpages which exist in Debian...

greped all and found not the right thing.
A little bit frustrating.

> 	sean


Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature

Reply to: