-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query UPower's OnBattery property directly.
On some systems, the name of the battery or the adapter may be different. The code assumes the adapter is called "line_power_AC" and the battery "BAT0" but in my system both are different. UPower has the OnBattery property which we can query and this is more robust. Additionally, we can do it directly throuth the dbus API without invoking a sub-process.
- Loading branch information
Showing
1 changed file
with
12 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters