Detecting OS and Window Manager

Andrew Wilkinson ajw126 at york.ac.uk
Wed Jun 5 19:11:40 EDT 2002


Thanks for all the replies guys.

Basically I want to have a program that hides itself in the taskbar of
whatever the user is running. Unfortunately there isn't (or at least I don't
know of) a portable way of doing this. I guess I'll just have to mess around
with looking for the environment variables and then code it up for
KDE/Gnome/whatever.

Thanks again
Andrew

"Sean 'Shaleh' Perry" <shalehperry at attbi.com> wrote in message
news:mailman.1023309760.22815.python-list at python.org...
>
> On 05-Jun-2002 Tim Hammerquist wrote:
> > Andrew Wilkinson graced us by uttering:
> >> I'm writing a program that integrates with a number of different OSes
> >> and Window Managers (under Linux), but I need to check what the user
> >> is running.  I know that...
> >>
> >> import os
> >> if os.name == 'nt':
> >>
> >> will tell me they're running NT. But under Linux I'd like to know if
> >> they are running KDE or Gnome, does anyone know a (preferably) simple
> >> test for this?
> >
> > Well, windowmanagers aren't as static as operating systems are.  It's
> > actually possible to run more than one wm at a time.
> >
> > In any case, I went and experimented with the various wms on my system
> > and in all cases the $WINDOWMANAGER shell var was set to the full path
> > of the running wm executable.  This appears to be the only consistent
> > and reliable var in my environment; for instance, here's a dump of my
> > wm-related vars:
> >
>
> WINDOWMANAGER is not one I am familiar with -- is KDM or GDM setting it?
None
> of the machines I looked at had it set.
>
>





More information about the Python-list mailing list