Detecting OS and Window Manager

Jim Richardson warlock at eskimo.com
Fri Jun 7 20:35:51 EDT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 07 Jun 2002 00:34:30 +0100,
 Darren Winsper <dw133 at cs.york.ac.uk.go.away> wrote:
> In <mailman.1023304388.9659.python-list at python.org>, Sean 'Shaleh' Perry
> wrote:
> 
>> the only fool proof way to detect KDE, GNOME, etc is to check for X atoms.  The
>> bigger question is why do you care?  As long as they can display a GUI you
>> should not be bothered about which one it is.  Especially under the X Window
>> System it was designed so that random applications DIDN'T know what they were
>> running under.
> 
> As the person writing the KDE front-end to the mentioned application, let
> me answer your question.  The idea is that if the user is running KDE,
> then they get a KDE front-end by default.  I also hope that should
> somebody write a GTK/GNOME front-end, if the user was running GNOME they
> would get a GTK-based front-end by default.  It's good UI design.
> 
>> Also remember KDE is not a window manager, it is a desktop environment.  It is
>> perfectly reasonable to run KDE and use fvwm (or even twm) as the window
>> manager.  Same applies to GNOME.
> 
> OK, Andrew meant DE instead of window manager, but it's still a valid
> question.
> 
>> Also, what about someone who only runs say
>> Window Maker and never uses GNOME or KDE?
> 
> Well, in that case we just choose a default.  The thing is, we want to
> detect if PyKDE is installed.  If it is, then we can do "import kdecore"
> without risk of it throwing an exception.  If it isn't, I'd rather not
> have to try something along the lines of attempting "import kdecore" and
> then having to catch an exception if it's not found.
> 


But the only way to see if PyKDE is installed, is to check it, KDE
doesn't require PyKDE, you can't assume that PyKDE will be present
simply because someone is running KDE. About the only way I can see you
toing this, is with a whole lot of try/fail checks, and even then, if
someone is running something other than KDE/Gnome, you will be back to
the default. Why not start the default front end first time, then ask
the user what front end they would prefer, then save that to a dotfile? 


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9AVFmd90bcYOAWPYRAnkSAKC/z+7HbHqAUEQj53vSdOTUc2QNqACeOArx
jTNFcrwH8pAs57SSjsYHiA4=
=Ooz6
-----END PGP SIGNATURE-----

-- 
Jim Richardson
	Anarchist, pagan and proud of it
http://www.eskimo.com/~warlock
Linux, from watches to supercomputers, for grandmas and geeks. 



More information about the Python-list mailing list