Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: Ways to detect what window system is running. Message-ID: <9104130354.AA09118@lightning.McRCIM.McGill.EDU> Date: 13 Apr 91 03:54:54 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 23 > I am looking for scripts or ideas for how to detect what window > system is running. We need to run different versions of the same > program when under X Windows or SunView. (Assuming that by "X Windows" you mean The X Window System, or X for short....) The usual thing to do is to check for DISPLAY in the environment, which implies X, or WINDOW_PARENT, which implies SunView. (If both are set, you are probably in some environment where either one will work, so use whichever provides a better interface for your program.) > Ways to detect Sun's X News server and MIT X would be helpful as > well. Check the vendor string (see XServerVendor() and possibly XVendorRelease() in the Xlib documentation). The MIT server I'm using now returns "MIT X Consortium" and "4", at least according to xdpyinfo. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu