So I want to read the title of user's active window on Linux, from python. I have an implementation for X and I know you can't do that on Wayland, so I want the feature to be completely disabled when user is using Wayland. I can detect that there's no X, but here's a gotcha: user can run xwayland, in which case X server is running. Is it possible to detect such scenario? I could somehow detect that wayland process is running, or check for some wayland-specific variables, but that seems half-assed to me. What if some other alternative to Wayland emerges? (like there is Mir, even though no one uses it) Ideally I'd want some X-only way of telling that it's running as a compatibility layer. Is that possible?