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}" )"
Comments