25

I'm using Ubuntu 15.10 and i want to know which display server is running. In first version of Ubuntu it is definitely X server, but recently i got updated my Ubuntu 15.10 and i came to know that some Mir Server packages are going to be installed so how will i know that either Mir is running or X Server?

3 Answers3

17

(Trying to improve @shcherbak answer.)

To get info about the running display server write in the console:

ps -e | grep tty

The out put might be, for example:

 1475 tty2     00:00:00 gdm-x-session
 1478 tty2     00:00:40 Xorg
 1489 tty2     00:00:00 gnome-session-b

One of the tty* results is the terminal where you have the GUI in your linux system (usually tty7 though I use tty2 in my example). Therefore, this should be the terminal where the display server (X11, Mir, or whatever) is running.

For example, the results show 1478 tty2 00:00:40 Xorg, so this would be running Xorg (that is, X11).

Shscherbak answer would just output the running processes that contain a capital X, "X". Among others, of course, Xorg, in case it is present. But if another display server is running, you miss the information. :)

loved.by.Jesus
  • 401
  • 5
  • 15
  • 2
    It output nothing on my computer. – Elouan Keryell-Even Jun 12 '19 at 13:20
  • @ElouanKeryell-Even the `ps` and `grep` command are really basic commands of linux, therefore I can only infer that your computer does not uses the `tty7` for the GUI. I am sorry. https://askubunt-u.com/questions/27339/what-is-tty7-in-the-commandline#27444 – loved.by.Jesus Jun 18 '19 at 19:50
6

try look your process list:

ps -e | grep X
shcherbak
  • 493
  • 2
  • 10
  • 2
    This would return the running processes that contain a capital X (e.g., Xorg), but would not show another display server if it is running. – iND Jan 09 '20 at 14:19
0

with Ubuntu Ubuntu 22.04.2 LTS

I needed a slightly different approach:

ps -ef | grep -i tty

shows me an entry that contains

/var/run/sddm

so I currently use SDDM Display Manager.

next step:

Find out if Wayland or X is active ...

opinion_no9
  • 251
  • 2
  • 8