From b9fdf830966d6544788477d68aa3a0f2b95a725f Mon Sep 17 00:00:00 2001 From: Nicolas Derumigny Date: Fri, 4 Nov 2022 22:05:28 -0600 Subject: [PATCH] indicator.js: ensuring compatibility with older GNOME versions --- src/indicator.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/indicator.js b/src/indicator.js index e48e242..a6828ac 100644 --- a/src/indicator.js +++ b/src/indicator.js @@ -108,7 +108,12 @@ var CPUFreqIndicator = class CPUFreqIndicator extends baseindicator.CPUFreqBaseI } enable() { - this.power = imports.ui.main.panel.statusArea.quickSettings._system._systemItem._powerToggle; + if (parseFloat(Config.PACKAGE_VERSION.substring(0, 4)) >= 43) { + this.power = imports.ui.main.panel.statusArea.quickSettings._system._systemItem._powerToggle; + } else { + this.power = Main.panel.statusArea["aggregateMenu"]._power; + } + this.powerState = this.power._proxy.State; this.powerConnectSignalId = this.power._proxy.connect( "g-properties-changed",