I'd like to support multiple GNOME versions with my shell extension. How can I detect the GNOME version it's running on and branch the code appropriately?
What are GNOME Shell Extensions? GNOME Shell extensions are small pieces of code written by third party developers that modify the way GNOME works. (If you are familiar with Chrome Extensions or Firefox Addons, GNOME Shell extensions are similar to them.)
GNOME Shell is the graphical shell of the GNOME desktop environment starting with version 3, which was released on April 6, 2011. It provides basic functions like launching applications, switching between windows and is also a widget engine. GNOME Shell replaced GNOME Panel and some ancillary components of GNOME 2.
Install Gnome ExtensionsNavigate your Firefox browser to https://extensions.gnome.org/ and simply search for Gnome extensions you wish to install. Flip the ON switch to install the extension. Install extension by clicking on the ON switch. Click Install to confirm the gnome extension installation.
const Config = imports.misc.config;
if (Config.PACKAGE_VERSION.startsWith("3.42"))
// etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With