How to check using the command line which display manager is running?

How can I determine the name of the display manager in use solely by using the command line?


Solution 1:

Short answer:

As mentioned in this answer on Unix & Linux, you should be able to get that from:

cat /etc/X11/default-display-manager

I tried it on both Unity and XFCE, both worked.