How could I get name in Python of the display server that is used in current Linux session?
I want to know if user uses Xorg or Wayland for example.
How could I get name in Python of the display server that is used
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need an Xlib
Displaypointer and a way to call ServerVendor() and possiblyVendorRelease().With.pygtk, you can use gdk_x11_display_get_xdisplay() to get aDisplay *Update: I stand corrected:
gtkmmhas a binding to this function butpygtkapparently does not.The library still might provide access to the information returned by
ServerVendor()(a quick search shows several calls but most of them seem to be used for compatibility workarounds).Even Python-Xlib does not seem to provide a binding to
ServerVendor(). You may have to write your own module.