The process name used to run the Xorg server changed recently on RHEL from X to Xorg and more recently the XWayland came along as the new Wayland server has been introduced. I noticed that on old versions the Xorg process and the related command line argument was something like this:
/usr/bin/X -nr -nolisten tcp :0 vt1 -auth /var/run/kdm/A:0-uyAhRO
The X file was actually just a symbolic link to /usr/bin/Xorg. Then on RHEL8 the command changed to something like:
/usr/libexec/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
The following questions arise from the topic:
1) Why the old versions was using X as process name instead of Xorg ?
2) Why the DISPLAY argument (:0) has been removed in the latest releases ?
3) I could figure out what display the Xorg server was running on just by reading the process command line arguments. This is not working anymore. What if need to do this on modern distros ?
4) I already get the DISPLAY variable from the program environment but I need to check if this matches the Xorg display. This because I need to run the program on the same display where Xorg is running. Is it still relevant to perform this check or can I assume ":0" nowadays ?