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

2005-04-05 Thread Martin Schulze
Michelle Konzack wrote: Hello Martin, s/Martin/Joey/g FWIW: That's not always the case. Below is a real-world example from a woody system with XDM: koulutie!joey(pts/4):~ w 19:28:13 up 29 days, 8:52, 6 users, load average: 0.02, 0.04, 0.06 USER TTY FROM

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

2005-04-05 Thread Michelle Konzack
Hi Joey, Am 2005-04-05 11:31:48, schrieb Martin Schulze: Michelle Konzack wrote: Hello Martin, s/Martin/Joey/g :-) It doesn't, if X is started via startx, though. Argh !!! - My test system IS startet from the console and startx. So, this was the error... Ah, finally,

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

2005-04-04 Thread Martin Schulze
Michelle Konzack wrote: I asume your are using TESTING or UNSTABLE... Under STABLE I get only something like joss pts/0Mar 26 14:42 joss pts/1Mar 26 14:42 toto pts/2Mar 26 15:06 This is, why I have asked... The test I must do, should work under WOODY

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

2005-04-04 Thread Michelle Konzack
Hello Martin, Am 2005-04-04 19:31:45, schrieb Martin Schulze: FWIW: That's not always the case. Below is a real-world example from a woody system with XDM: koulutie!joey(pts/4):~ w 19:28:13 up 29 days, 8:52, 6 users, load average: 0.02, 0.04, 0.06 USER TTY FROM

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

2005-03-28 Thread David Weinehall
On Mon, Mar 28, 2005 at 12:01:05AM +0100, Marc Haber wrote: On Sun, 27 Mar 2005 20:23:29 +0200, Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-03-27 20:12:37, schrieb Marc Haber: You should ask user-related questions on a user-related mailing list. I have asked here because I have

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

2005-03-28 Thread Michelle Konzack
Am 2005-03-27 14:23:16, schrieb Sean Perry: 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

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

2005-03-27 Thread sean finney
On Fri, Mar 25, 2005 at 10:08:48PM +0100, Michelle Konzack wrote: My Problem is, HOW to find the $USER who is connected to a $DISPLAY. i have a small shell function that does this in a project i'm working on. this isn't the least hackish way of doing it, but here goes: get_desktop_owner () {

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

2005-03-27 Thread Michelle Konzack
Am 2005-03-26 15:07:37, schrieb Josselin Mouette: Le vendredi 25 mars 2005 à 22:08 +0100, Michelle Konzack a écrit : Hello *, curently I am coding a tool which run from cron (as root) periodicly and if a $USER is loged into X it shows Messages. My Problem is, HOW to find the $USER

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

2005-03-27 Thread Michelle Konzack
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

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

2005-03-27 Thread Marc Haber
On Sun, 27 Mar 2005 20:04:24 +0200, Michelle Konzack [EMAIL PROTECTED] wrote: The test I must do, should work under WOODY and higher Releases. You should ask user-related questions on a user-related mailing list. Greetings Marc -- -- !! No courtesy copies,

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

2005-03-27 Thread Michelle Konzack
Am 2005-03-27 20:12:37, schrieb Marc Haber: You should ask user-related questions on a user-related mailing list. I have asked here because I have already gotten unuseful $USER answers. I need a qualified REAL solution. Greetings Marc Greetings Michelle -- Linux-User #280138 with the

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

2005-03-27 Thread Florian Weimer
* Michelle Konzack: curently I am coding a tool which run from cron (as root) periodicly and if a $USER is loged into X it shows Messages. My Problem is, HOW to find the $USER who is connected to a $DISPLAY. $USER should start a program that connects to some daemon, from which it receives

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

2005-03-27 Thread Sean Perry
sean finney wrote: i invite someone to invent a better way, i'd like to hear it :) Rather than invoke awk twice, just use awk for everything (-: (I used $DISPLAY for testing) w | awk \$3 ~ /$DISPLAY/ {print \$1; exit 0} Note the escaped '$'s. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a

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

2005-03-27 Thread Michelle Konzack
Am 2005-03-27 20:38:29, schrieb Florian Weimer: $USER should start a program that connects to some daemon, from which it receives the messages. Anything else is just a gross hack, I know, but HOW to get $USER to start the program ? insecure and likely to break in terminal server

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

2005-03-27 Thread Marc Haber
On Sun, 27 Mar 2005 20:23:29 +0200, Michelle Konzack [EMAIL PROTECTED] wrote: Am 2005-03-27 20:12:37, schrieb Marc Haber: You should ask user-related questions on a user-related mailing list. I have asked here because I have already gotten unuseful $USER answers. I need a qualified REAL

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

2005-03-27 Thread Vincent Zweije
On Sun, Mar 27, 2005 at 08:04:24PM +0200, Michelle Konzack wrote: || Am 2005-03-26 15:07:37, schrieb Josselin Mouette: || 15:03 [EMAIL PROTECTED] ~ who || joss :0 Mar 26 14:42 || joss pts/0Mar 26 14:42 (:0.0) || joss pts/1Mar 26 14:42 (:0.0) ||

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

2005-03-27 Thread sean finney
On Sun, Mar 27, 2005 at 10:14:03PM +0200, Vincent Zweije wrote: As I understand it, the program that puts these entries into the whois database is called sessreg. Have a look at it; it should be part of the X startup/shutdown script, at least for xdm. or, if you want to take it a level of

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

2005-03-27 Thread Michelle Konzack
Am 2005-03-27 18:25:20, schrieb sean finney: or, if you want to take it a level of abstraction deeper, these programs are all using the utmpx library calls to register the logins. w, who, last, and finger all use utmpx system calls to tell you about who's currently (or previously) logged in.

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

2005-03-26 Thread Josselin Mouette
Le vendredi 25 mars 2005 à 22:08 +0100, Michelle Konzack a écrit : Hello *, curently I am coding a tool which run from cron (as root) periodicly and if a $USER is loged into X it shows Messages. My Problem is, HOW to find the $USER who is connected to a $DISPLAY. If I start two xserver

How to detect which user is connected to $DISPLAY

2005-03-25 Thread Michelle Konzack
Hello *, curently I am coding a tool which run from cron (as root) periodicly and if a $USER is loged into X it shows Messages. My Problem is, HOW to find the $USER who is connected to a $DISPLAY. If I start two xserver I have e.g. :0 and :1. I was serching for a command which tell me which