Search code examples
gnome-shell-extensions

How can my GNOME Shell extension detect the GNOME version?


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?


Solution

  • const Config = imports.misc.config;
    if (Config.PACKAGE_VERSION.startsWith("3.42"))
        // etc.