I want to check which Window Manager the user is using (like GNOME or KDE etc.). How do I do that?
A:
You can't. There is no central place where a program registers itself to say "hi, I'm the window manager".
For instance, I'm running xmonad. I simply start this by calling xmonad
in my ~/.xsession
file along with a couple of other programs to have it start when I login. You cannot really detect that.
Daniel Egeberg
2010-07-26 08:23:56
I just thought of something, the Window Manager is just like any other program right? So it is in the processes list, for example, I'm running GNOME, and I got a process called 'gnome-sessions'. So I could check if that process is running so I know the user uses GNOME. You can't run 2 or more WM's at the same time anyhow right?
Jay
2010-07-26 08:35:29
@Jay: Sure, if you have a list of all window managers, I suppose you could. There are a lot of different ones though. You cannot make a general solution.
Daniel Egeberg
2010-07-26 08:38:57
See `xnest` or `Xephyr` or `startx -- :1` for reasons why your assumption of "can't run 2 or more WM's at the same time" is incorrect.
sarnold
2010-07-26 09:20:57