Skip to content

Commit

Permalink
indicator.js: ensuring compatibility with older GNOME versions
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasDerumigny committed Nov 5, 2022
1 parent 43015f2 commit b9fdf83
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b9fdf83

Please sign in to comment.