Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Wikipedia has a pretty good article on this: en.wikipedia.org/wiki/X_display_manager_%28program_type%29 – Let_Me_Be Sep 9 '11 at 14:39

Unfortunately the configuration differs for each distribution:

Debian (should also apply to Ubuntu)


RedHat (should also apply to Fedora)



share|improve this answer
Huh, why are you telling me about configuration...? – ptrcao Sep 9 '11 at 15:49
@ptrcao Because it specifies what display manager you are using. – Let_Me_Be Sep 9 '11 at 15:51
Suppose I don't know what my display manager is and I want to find out by using terminal. How would I do that? – ptrcao Sep 9 '11 at 15:55
@ptrcao You would look into those files. Either opening them in your favorite editor, or just doing cat. – Let_Me_Be Sep 9 '11 at 15:56
It has only one line in it: /usr/bin/xdm - does that mean xdm is my display manager? – ptrcao Sep 9 '11 at 15:59

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 startx, no display manager is involved.

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. lsof /tmp/.X11-unix/X${DISPLAY#:} will show the X server process (assuming the X sockets live in /tmp/.X11-unix).

x=$(lsof -F '' /tmp/.X11-unix/X0); x=${x#p}
ps -p $(ps -o ppid -p $x)

(Explanation: lsof -F '' prints output like p1234. The -F option means a machine-parseable output format, and '' means to only print the PID, with the letter p before it. x=${x#p} strips off the initial letter p. The last line obtains the PID of the parent of the X server (ps -o ppid -p $x), and calls ps to show information about that parent process.)

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:

aptitude -F %p search '~i ~P^x-display-manager$'


</var/lib/dpkg/status awk '
    /^Package: / {package = $2}
    /^Provides: .*x-display-manager/ {print package}'
share|improve this answer

The display manager name should be in DESKTOP_SESSION


returns "gnome" for me.

You're right. They're going back and forth on that on XFCEs bugzilla so it probably isn't very reliable.

share|improve this answer
@frabjous: What about gdm and kdm? Are they display managers too or just login managers? – ptrcao Sep 9 '11 at 14:39
I must've accidentally deleted frabjous' comment just above because I remember he remarked that Gnome is a desktop environment, not a display manager. This thread is abound with confusion... – ptrcao Sep 9 '11 at 15:48
This gives information about… the desktop session, which is likely to be the same thing as your desktop environment, but may be something else altogether if you're not using a desktop environment or you have a peculiar configuration. On the machine where I'm writing this, $DESKTOP_SESSION is unknown. – Gilles Sep 9 '11 at 23:56
+1, echo $DESKTOP_SESSION also returns gnome to me... but maybe this only works for gnome? – Trevor Boyd Smith Sep 17 '11 at 22:37
If it only works for gnome, this command will only help you deduce "yes you have Gnome or no you don't have gnome". When the question wants to find out more than that. – Trevor Boyd Smith Sep 17 '11 at 22:37

if you are using systemd based distribution.This command will give you name of display manger currently active because you may have more than one display manager installed.

cat /etc/systemd/system/display-manager.service | grep '/usr/bin'

OUTPUT will be like


Looks like i am using mint display manager.

share|improve this answer
You have presented a classic example of a Useless use of cat — it's perfectly acceptable, and even preferable, to say grep '/usr/bin' /etc/systemd/system/display-manager.service. (And, strictly speaking, since /usr/bin doesn't contain any characters that are special to the shell, you don't need to quote it — but it doesn't hurt.) – G-Man Feb 2 at 4:41
'useless use of cat' is always somewhat relative. I rather edit the last string of cat <file> | grep <searchterm> instead of the second one of grep <searchterm> <file> when grepping. – sjas Feb 7 at 21:59
That's Ironic , I used to laugh when people use cat in such a way. How come I did the same – allsyed Feb 19 at 5:42

In some case, wmctrl could help. This utility is compatible with a lot of windows managers.

wmcrt -m 

should display the name of the currently used window manager.

share|improve this answer
A window manager is not the same thing as a display manager. – HalosGhost Dec 15 '14 at 17:48

Like @Gilles said, the display manager will start your desktop environment.

According to the Debian Wiki, mostly these end with dm, only exception is slim.

So this should suffice for most of people's needs:

ps auxf | awk '{print $11}' | \grep --color -e dm$ -e slim$

Or to be sure, it exists as a parent process, and is not forked (except from the init system):

ps auxf | awk '{print $11}' | \grep -e "^/.*dm$" -e "/.*slim$" 
share|improve this answer
This is the only solution here that worked for me. Figured out that my Fedora 23 minimal with LXDE add-on (not the LXDE Spin) is running lightdm. The RedHat/Fedora solution from the top answer didn't work, the configuration seems to have moved. – Daniel Saner Feb 7 at 14:29

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:

xprop -id $(xprop -root _NET_SUPPORTING_WM_CHECK | cut -d\# -f2) WM_NAME

Which decomposes into

xprop -root _NET_SUPPORTING_WM_CHECK | cut -d\# -f2
xprop -id 0x1000052 WM_NAME
WM_NAME(STRING) = "xfwm4"

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):

The Window Manager MUST set this property on the root window to be the ID
of a child window created by himself, to indicate that a compliant window
manager is active.

And then you ask for the WM_NAME property of said window.

WM_NAME being:

The WM_NAME property is an uninterpreted string that the client wants the
window manager to display in association with the window (for example, in
a window headline bar). 
share|improve this answer
@frabjous: Xfwm4 is the Xfce window manager. Is that the same as a display manager? – ptrcao Sep 9 '11 at 14:39
@Mathieu You are talking about window managers, not display managers. – Let_Me_Be Sep 9 '11 at 14:41
@Let_Me_Be True but then most of the time, your window manager is tied to your display manager... How often do you use gnome window managerwith kde and vice-versa? And it actually works because gdm/kdm/whatever allow you to select your display manager, meaning reading the configuration file like you mentioned doesn't work if you don't use the provided default... – Mathieu Sep 9 '11 at 17:23
_NET_SUPPORTING_WM_CHECK gives information about the window manager, not about the display manager. It doesn't even always work; on my system, that property is set to a window ID but the window in question doesn't have a name. – Gilles Sep 9 '11 at 23:54
@Mathieu That depends on the distributions. Usually when you install a KDE version of the distro, you get KDM and when a gnome version, you get GDM. But the stuff that you will see more and more is official support for only one display manager (usually a more light-weight variant then GDM/KDM). – Let_Me_Be Sep 10 '11 at 0:32

As already mentioned, there is a lot of confusion in this thread. The original question is what display manager, not desktop manager or window manager. I'm currently running Xfwm4 which is Xfce window manager, and lxdm which is lightweight X11 display manager (from LXDE, not Xfce). You should be able to see what display manager you are using via htop. You've probably long since discovered the answer over the past 4 years :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.