[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to find out the current display manager?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Jan 15, 2017 at 09:47:40PM -0500, kamaraju kusumanchi wrote:
> How can I find out the display manager currently running on a machine
> from the command line?

Hm. How do you know there aren't two running? Or fifteen?

Yes, I know the question sounds at first a bit grumpy/wisecracky. Bear
with me :-)

- From some perspective (e.g. you are a shell script running in some
X terminal) still the notion of "the" display manager might make
sense: that would be the one which is y display manager *and* your
ancestor.

Have a look at this tree snippet from my machine, obtained by
"ps wauxf" (I snipped most of the columns and shortened things
a bit):

 | /usr/bin/xdm
 |  \_ /usr/lib/xorg/Xorg :0 vt7 -nolisten tcp -auth /var/lib[...]
 |  \_ -:0         
 |      \_ x-window-manager -s
 |          \_ /usr/bin/ssh-agent x-window-manager
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |          |   \_ bash
 |          |       \_ emacs
 |          |       \_ mutt
 |          \_ /usr/lib/fvwm/2.6.5/FvwmCommandS 8 5 /home/tomas/.fvwm/config 0 8
 |          \_ /usr/lib/fvwm/2.6.5/FvwmButtons 9 4 none 0 8
 |          \_ /usr/lib/fvwm/2.6.5/FvwmIconMan 11 4 none 0 8
 |          \_ /usr/lib/fvwm/2.6.5/FvwmAnimate 13 4 none 0 8
 |          \_ /usr/lib/fvwm/2.6.5/FvwmPager 17 4 none 0 8 FvwmPager-Single * *
 |          \_ xbiff -geometry +5000+5000 -bg rgb:7070/8c8c/8c8c -fg rgb:0000/0000/0000
 |          \_ xclock -norender -geometry +5000+5000 -bg rgb:7070/8c8c/8c8c -fg rgb[...]
 |          \_ xterm -class bat -bg black -fg white -geometry +5000+5000 -fn xft:DejaVu [...]
 |          |   \_ watch -tn 10 bat
 |          \_ xload -geometry +5000+5000 -bg rgb:7070/8c8c/8c8c -fg rgb:0000/0000/0000[...]
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |          |   \_ bash
 |          |       \_ xscreensaver
 |          |       \_ fetchmail -Nkd 30
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |          |   \_ bash
 |          |       \_ /bin/bash /home/tomas/bin/tun
 |          |           \_ socat [...]
 |          |               \_ socat [...]
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |          |   \_ bash
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |          |   \_ bash
 |          |       \_ ssh tomas@tuxteam.tun
 |          \_ xterm -fg rgb:ffff/ffff/ffff -bg rgb:0000/0000/5050
 |              \_ bash
 |                  \_ ps wauxf
 |                  \_ bash

The display manager(s) are thus the root(s) of those process trees which
contain an X session (unless there's no login at the moment). If you are
interested in "your" display manager, you only have to ascend your
process tree until you hit a program which "is" a display manager.

If you have control on your whole environment, you can make your life
easier and set up your session to export a shell variable (the session
above is this process with the funny name "-:0", which parents everything
running under X in my box). There are admin-settable things in the session
machinery (mainly in /etc/X11/xinit/, as shell script snippets which are
dot-included (remember? they want to be able to set env vars) at start,
and branch out, as needed, to per-user script snippets.

This is a pretty "classical" view. No idea how things work under
systemd or Wayland.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlh8lW8ACgkQBcgs9XrR2kZ6bgCfSWliySpBB0zhlwj0eQnM7a7O
VnAAn1uUUjFebyJpnX/IpOm9HqSgGO+k
=R7MN
-----END PGP SIGNATURE-----


Reply to: