[comp.windows.x] Detecting user on Xterm or else.How ???

izar@shuldig.huji.ac.il (Izar Tarandach) (06/01/91)

	Hi!
	I'm writing a program that I'd like be able to check if a given user
is in a X terminal or not - depending on the result, I'd send a message in
written format or a X window - anybody knows a good way to do that ?

	Thanks in advance.

						Izar


-- 
+--------------------Izar Tarandach  izar@shum.huji.ac.il---------------------+
|I used to live in the sunniest place on Earth.Now I live in the brightest.   |
|   Where every human being is a soldier, and every soldier a human being.    |
+-disclaimer:All opinions are MY responsability - HUJI/Jerusalem, Israel------+

dj@ctron.com (DJ Delorie) (06/03/91)

In article <1991Jun1.152202.12891@bronze.ucs.indiana.edu>, izar@shuldig.huji.ac.il (Izar Tarandach) writes:
> 	I'm writing a program that I'd like be able to check if a given user
> is in a X terminal or not - depending on the result, I'd send a message in
> written format or a X window - anybody knows a good way to do that ?

I've noticed that xterm sets the WINDOWID environment variable to the
window id of the window it uses - might be useful.

DJ
dj@ctron.com

wittig@gmdzi.gmd.de (Georg Wittig) (06/04/91)

dj@ctron.com (DJ Delorie) writes:

>> 	I'm writing a program that I'd like be able to check if a given user
>> is in a X terminal or not - depending on the result, I'd send a message in
>> written format or a X window - anybody knows a good way to do that ?

>I've noticed that xterm sets the WINDOWID environment variable to the
>window id of the window it uses - might be useful.

Alas, this doesn't solve the problem always:

	- On DECstations you can call a dxterm (DEC-specific xterm) from an
	  xterm, and the $WINDOWID is still set. So you cannot distiguish
	  between an xterm and a dxterm.

	- ``xterm -e rlogin otherhost'' doesn't define $WINDOWID on the
	  otherhost.

Any solutions for those problems?

-- 
Georg Wittig   GMD-Z1.IT   P.O.Box 1240 | "Freedom's just another word
D-W-5205 St. Augustin 1	   (Germany)	|  for nothing left to lose"
email:		wittig@gmdzi.gmd.de	| (from "Me and Bobby McGee",
telephone:	(+49) 2241 14-2294	|  Janis Joplin, Kris Kristofferson)