How do I use Python to check if the Gnome running is Gnome 2 or Gnome 3 ?
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.
Both gnome 2 and gnome 3 use information from a certain file to display gnome version in System Info. The file in question is called gnome-version.xml
In gnome 3 it is part of the package gnome-desktop so it shouldn’t be missing from any gnome 3 install regardless the distro. The difference is that in gnome 2 it’s either installed in
/usr/share/gnome-about/gnome-version.xml
or missing, while in gnome 3 it’s always located here:
/usr/share/gnome/gnome-version.xml
So I guess it’s only a matter of checking for the right file in the right location.