mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
* usr/lib/byobu/battery: LP: #1270451
- add support for yet another batter type (Android) - thanks to Felix Krull for the initial patch
This commit is contained in:
parent
2ac6910b8c
commit
4435c0c443
2 changed files with 11 additions and 5 deletions
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -6,6 +6,9 @@ byobu (5.74) unreleased; urgency=low
|
||||||
https://github.com/erans/ec2instancespricing
|
https://github.com/erans/ec2instancespricing
|
||||||
* usr/share/byobu/profiles/tmux: LP: #1273685
|
* usr/share/byobu/profiles/tmux: LP: #1273685
|
||||||
- remove double sourcing of local .tmux.conf
|
- remove double sourcing of local .tmux.conf
|
||||||
|
* usr/lib/byobu/battery: LP: #1270451
|
||||||
|
- add support for yet another batter type (Android)
|
||||||
|
- thanks to Felix Krull for the initial patch
|
||||||
|
|
||||||
[ Arminius Silvanus ]
|
[ Arminius Silvanus ]
|
||||||
* usr/share/byobu/profiles/bashrc: LP: #1280550
|
* usr/share/byobu/profiles/bashrc: LP: #1280550
|
||||||
|
|
|
@ -37,9 +37,10 @@ __battery() {
|
||||||
/sys/*)
|
/sys/*)
|
||||||
if [ -r "$bat/uevent" ]; then
|
if [ -r "$bat/uevent" ]; then
|
||||||
. "$bat/uevent"
|
. "$bat/uevent"
|
||||||
[ "$POWER_SUPPLY_NAME" = "AC" ] && continue
|
case "$POWER_SUPPLY_NAME" in AC|ac|Ac|aC) continue ;; esac
|
||||||
present="$POWER_SUPPLY_PRESENT"
|
present="$POWER_SUPPLY_PRESENT"
|
||||||
# Some use "CHARGE", others use "ENERGY"
|
# Some use "CHARGE", others use "ENERGY", still others "CAPACITY"
|
||||||
|
[ -n "$POWER_SUPPLY_CAPACITY" ] && rem="$POWER_SUPPLY_CAPACITY" && full="100"
|
||||||
[ -n "$POWER_SUPPLY_CHARGE_FULL" ] && full="$POWER_SUPPLY_CHARGE_FULL"
|
[ -n "$POWER_SUPPLY_CHARGE_FULL" ] && full="$POWER_SUPPLY_CHARGE_FULL"
|
||||||
[ -n "$POWER_SUPPLY_ENERGY_FULL" ] && full="$POWER_SUPPLY_ENERGY_FULL"
|
[ -n "$POWER_SUPPLY_ENERGY_FULL" ] && full="$POWER_SUPPLY_ENERGY_FULL"
|
||||||
[ -n "$POWER_SUPPLY_CHARGE_NOW" ] && rem="$POWER_SUPPLY_CHARGE_NOW"
|
[ -n "$POWER_SUPPLY_CHARGE_NOW" ] && rem="$POWER_SUPPLY_CHARGE_NOW"
|
||||||
|
@ -86,10 +87,12 @@ __battery() {
|
||||||
bcolor="b G k"
|
bcolor="b G k"
|
||||||
fi
|
fi
|
||||||
percent="${percent}${PCT}"
|
percent="${percent}${PCT}"
|
||||||
|
# Convert state to lower case
|
||||||
|
state=$(printf "%s" "$state" | $BYOBU_SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||||
case $state in
|
case $state in
|
||||||
charging|Charging|Unknown) sign="+" ;;
|
charging) sign="+" ;;
|
||||||
discharging|Discharging) sign="-" ;;
|
discharging) sign="-" ;;
|
||||||
charged|Unknown|Full) sign="="; percent="" ;;
|
charged|unknown|full) sign="=" ;;
|
||||||
*) sign="$state" ;;
|
*) sign="$state" ;;
|
||||||
esac
|
esac
|
||||||
if [ -z "$percent" ]; then
|
if [ -z "$percent" ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue