Is there a simple linux command that will tell me what my display manager is?
I'm using Xfce. Are different desktop environments usually affiliated with different display managers?
Unfortunately the configuration differs for each distribution:
Debian (should also apply to Ubuntu)
RedHat (should also apply to Fedora)
There isn't. The display manager is not necessarily related to anything else that's running on the same X server. The display manager runs before you log in; it's chosen by the system administrator. Everything else (window manager, session manager, desktop environment, …) is chosen by the user. There doesn't even have to be a display manager: if you log in in text mode and start the GUI with
You can check which display manager is the default one on your system. This will only give the right answer under some common but not universal assumptions. If you manually ran a different manager for whatever reason, this method won't tell you.
A good bet is to find out the process ID of the X server: its parent process is probably a display manager, if there is one. This requires that your clients are running on the same machine as the X server.
Some distributions allow installing multiple display managers. There'll only be a single one running unless you have a multiseat system though. To list all installed display manager packages under Debian and derivatives:
The display manager name should be in DESKTOP_SESSION
returns "gnome" for me.
In some case, wmctrl could help. This utility is compatible with a lot of windows managers.
should display the name of the currently used window manager.
X is highly modular so if you really wanted it, yes, you could mix desktop environments and windows managers. After all a window manager is just a way to paint windows (that's the simple view).
So if you take gnome, metacity used to be the windows manager but now it's been replaced by Mutter.
The issue with mixing is in modern desktop environments, desktop and window manager are highly tied to one another. Too much mixing could end up in fewer functionality.
As mentioned $DESKTOP_SESSION works but if you want to ask your X11 server, you could do this:
Which decomposes into
Which gets the id of the window created by the window manager. The specs says (http://standards.freedesktop.org/wm-spec/1.3/ar01s03.html):
And then you ask for the WM_NAME property of said window.