Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Linux find running display manager

In GNU/Linux, if you ever need to know what your currently running display manager is, here is how you can find it:

x="$( sudo lsof -F '' /tmp/.X11-unix/X0 | head -n1 )" ; x="${x#p}"
display_manager="$( ps -p $( ps -o ppid -p ${x} | tail -n +2 ) -ho command )"
thisdm="$( basename "${display_manager}" )"

References

Weblinks

  1. https://unix.stackexchange.com/questions/20370/is-there-a-simple-linux-command-that-will-tell-me-what-my-display-manager-is

Comments