p. 351
14.2 Are You Running Wayland or X?
As we start with our hands-on discussion, you need to determine which graphical system you have. Just open a shell and check the value of the $WAYLAND_DISPLAY environment variable. If the value is something like wayland-0, you’re running Wayland. If it’s not set, you’re running X (probably; there are exceptions, but you’re not likely to come across them with this test).
These two systems are not mutually exclusive. If your system uses Wayland, it is also probably running an X compatibility server. It’s also possible to start a Wayland compositor inside X, but that can get a little strange (more on this later).