问题
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?
回答1:
const Config = imports.misc.config;
if (Config.PACKAGE_VERSION.startsWith("3.42"))
// etc.
来源:https://stackoverflow.com/questions/34120963/how-can-my-gnome-shell-extension-detect-the-gnome-version