PowerStatus: make the primary device activatable
If the primary device is not virtual, make it open gnome-power-statistics on activate. https://bugzilla.gnome.org/show_bug.cgi?id=635880
This commit is contained in:
parent
6aac51a2a7
commit
991a0c642b
@ -121,6 +121,18 @@ Indicator.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._primaryDeviceId = device_id;
|
this._primaryDeviceId = device_id;
|
||||||
|
if (this._primaryDeviceId) {
|
||||||
|
this._batteryItem.actor.reactive = true;
|
||||||
|
this._batteryItem.actor.can_focus = true;
|
||||||
|
this._batteryItem.connect('activate', function(item) {
|
||||||
|
let p = new Shell.Process({ args: ['gnome-power-statistics', '--device', device_id] });
|
||||||
|
p.run();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// virtual device
|
||||||
|
this._batteryItem.actor.reactive = false;
|
||||||
|
this._batteryItem.actor.can_focus = false;
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user