Detecting OS and Window Manager

Graham Ashton graz at
Wed Jun 5 21:05:49 CEST 2002

On Wed, 05 Jun 2002 19:53:21 +0100, Andrew Wilkinson wrote:

> I'd like to know if
> they are running KDE or Gnome, does anyone know a (preferably) simple
> test for this?

I suspect your best bet is to resort to environment variables. I just
typed "env | grep -i gnome" and found out that (as I'm running GNOME) I
have an env variable called GNOME_SESSION_NAME (accessible via os.environ)

I've no idea how portable that is though. I'm running Ximian GNOME 1.4.


More information about the Python-list mailing list