Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!hp4nl!svin02!wsinti01!pp From: pp@wsinti01.info.win.tue.nl (Peter Peters) Newsgroups: comp.windows.x Subject: Detection which windowing system I'm in Keywords: open windows,sunview,bare terminal Message-ID: <1768@svin02.info.win.tue.nl> Date: 19 Feb 91 08:16:01 GMT Sender: news@svin02.info.win.tue.nl Reply-To: pp@info.win.tue.nl Lines: 27 Can anyone shed some light on the following problem : I have a window labelling mechanism (to change the headers in the window title bar) that I want to use when in open windows and/or sunview. To be able to do so, I have to know whether I'm in a window manager or not. All of this is possible using checks on environment variables, but these checks ar not 100%. Anyone can define e.g. OPENWINHOME or LD_LIBRARY_PATH to be whatever they want, so the existence of these environment variables do not ensure you are in open windows. So what are the correct methods to determine if I'm 1 - on the bare console. (I'm using `tty` == /dev/console right now) 2 - in sunview 3 - in open windows 4 - remote logged in via 1..3 And these cases should all be distinguishable.... Any pointers will be appreciated. -- | Peter Peters | UUCP : pp@win.tue.nl | | Eindhoven University of Technology (TUE) | PHONE : +31-(0)40-474120 | | Dept. of Mathematics and Computer Science | TUE : HG 8.82 / 4120 | | Disclaimer : I said WHAT ??? | VHF : pa0ppe |