gnome-shell-system-monitor-applet
gnome-shell-system-monitor-applet copied to clipboard
Battery not working since GS 45 port
https://github.com/mgalgs/gnome-shell-system-monitor-applet/blob/609b478c187a9bcc863ac1ac423b00d39bce3275/system-monitor-next%40paradoxxx.zero.gmail.com/extension.js#L1059-L1062
You can implement something like this (I don't have a laptop to make some test),
_checkDevices() {
if (this._timeoutId) {
GLib.source_remove(this._timeoutId);
this._timeoutId = null;
}
this._network = Main.panel.statusArea.quickSettings._network;
if (this._network) {
if (!this._network._client) {
// Shell not initialized completely wait for max of 100 * 1s
console.log(`${this._extensionName}: Gnome Shell is not inizialized`);
if ((this._nAttempts += 1) < 100) {
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
1000, this._checkDevices.bind(this));
}
} else {
this._client = this._network._client;
for (let device of this._network._wirelessToggle._nmDevices)
this._deviceAdded(this._client, device);
this._signalManager.addSignal(this._client, 'device-added', this._deviceAdded.bind(this));
this._signalManager.addSignal(this._client, 'device-removed', this._deviceRemoved.bind(this));
}
}
}
from gnome-shell-extension-wifiqrcode - WifiQrCode.js file.