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

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

Michelle Konzack wrote:

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

user    /dev/pts/1      <time>

well, the 'w' program from procps has not really changed. My woody box has procps version 2.0.7. So either a) you have an odd version or b) the utmp data has changed. If b) is the real answer then as others have pointed out there may be no useful way to accomplish this task.

Something akin to d-bus is one solution. You asked earlier how this works. The idea is that either the XDM (or workalike) or the user's .xinitrc or perhaps even the window manager / session manager would start a program which would announce their presence to the system. Not unlike how IM clients work and with a similar purpose. A program can then query ans ask "who has open X sessions?", "who is on display $FOO?", etc.

Reading the w or who output is pretty simple and most people will be moving up to sarge soon, I do not know too many people really using Woody any more.

Reply to: