Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class Extension {
});
}


_refresh() {
const devices = this._findDevices();
devices.forEach((device, index) => {
Expand All @@ -81,13 +82,14 @@ class Extension {
const icons = {};
icons[UPower.DeviceKind.MOUSE] = { icon: 'input-mouse-symbolic' };
icons[UPower.DeviceKind.KEYBOARD] = { icon: 'input-keyboard-symbolic' };
icons[UPower.DeviceKind.GAMING_INPUT] = { icon: 'input-gaming-symbolic' };
const devices = [];
const upowerClient = UPower.Client.new_full(null);
const udevices = upowerClient.get_devices();
const newProxies = {}
for (let i = 0; i < udevices.length; i++) {
const udevice = udevices[i];
if (udevice.kind in icons) {
if (udevice.kind in icons) {
if (udevice.state != UPower.DeviceState.UNKNOWN || udevice.native_path.includes("bluez")) {
const icon = icons[udevice.kind];
Log('Found device: ' + icon.icon + ' | ' + udevice.native_path);
Expand Down
2 changes: 1 addition & 1 deletion indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var IndicatorController = GObject.registerClass(
this._labels = [];
this._icons = [];
this._menuItems = [];
this._prevDevicesSettings = [];
this._prevDevicesSettings;
}

refresh(devices) {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
],
"url": "https://github.com/codilia/upower-battery",
"uuid": "upower-battery@codilia.com",
"version": 4
"version": 4.1
}