Skip to content

Commit

Permalink
* Add @cheginit's fix for detecting battery.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgilmer committed Jan 29, 2020
1 parent ab2e40e commit 5f7ec57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
regolith-i3xrocks-config (2.2.6-1ubuntu1~ppa1) eoan; urgency=medium

* Add @cheginit's fix for detecting battery.

-- Regolith Linux <[email protected]> Tue, 28 Jan 2020 21:25:36 -0800

regolith-i3xrocks-config (2.2.5-1ubuntu1~ppa1) eoan; urgency=medium

* Add discharge/recharge status to battery3.
Expand Down
3 changes: 2 additions & 1 deletion scripts/battery3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ get_battery_percent() {
echo "$__UPOWER_INFO" | awk -W posix '$1 == "percentage:" { gsub("%","",$2); print $2}'
}

__UPOWER_INFO=$(upower --show-info "/org/freedesktop/UPower/devices/battery_${BLOCK_INSTANCE:-BAT0}")
BATT_DEVICE=$(upower -e | grep -o 'BAT[0-9]' | HEAD -n 1)
__UPOWER_INFO=$(upower --show-info "/org/freedesktop/UPower/devices/battery_${BLOCK_INSTANCE:-$BATT_DEVICE}")

BATT_PERCENT=$(get_battery_percent)
CHARGE_STATE=$(get_battery_status)
Expand Down

0 comments on commit 5f7ec57

Please sign in to comment.