mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
* bin/battery: color the entire battery the same way
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
9ce20f41aa
commit
51c2d29d5c
2 changed files with 8 additions and 15 deletions
17
bin/battery
17
bin/battery
|
@ -56,24 +56,13 @@ for bat in $BATS; do
|
|||
fi
|
||||
|
||||
full=$(search "$infofile" "last full capacity: *\(.*\) m[AW]h")
|
||||
warn=$(search "$infofile" "design capacity warning: \(.*\) m[AW]h")
|
||||
low=$(search "$infofile" "design capacity low: \(.*\) m[AW]h")
|
||||
|
||||
rem=$(search "$statefile" "remaining capacity: *\(.*\) m[AW]h")
|
||||
if [ "$rem" -lt "$low" ]; then
|
||||
cap_color="{= rk}"
|
||||
elif [ "$rem" -lt "$warn" ]; then
|
||||
cap_color="{= yk}"
|
||||
else
|
||||
cap_color="{= gk}"
|
||||
fi
|
||||
|
||||
|
||||
percent=$( echo "$rem" "$full" | awk '{printf "%.0f", 100*$1/$2}')
|
||||
if [ "$percent" -lt 17 ]; then
|
||||
per_color="{= rk}"
|
||||
per_color="{= rw}"
|
||||
elif [ "$percent" -lt 33 ]; then
|
||||
per_color="{= Rk}"
|
||||
per_color="{= Rw}"
|
||||
elif [ "$percent" -lt 50 ]; then
|
||||
per_color="{= Yk}"
|
||||
elif [ "$percent" -lt 67 ]; then
|
||||
|
@ -103,5 +92,5 @@ for bat in $BATS; do
|
|||
;;
|
||||
esac
|
||||
|
||||
printf "\005%s%s\005{-}\005%s|%s|\005{-} " "$per_color" "$percent" "$cap_color" "$sign"
|
||||
printf "\005%s%s|%s|\005{-} " "$per_color" "$percent" "$sign"
|
||||
done
|
||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -16,6 +16,7 @@ byobu (2.4) unreleased; urgency=low
|
|||
instead, LP: #376080
|
||||
* bin/network-down,network-up,updates-available: use /var/run/screen
|
||||
for status cache files, to keep from waking up the disk
|
||||
* bin/battery: color the entire battery the same way
|
||||
* byobu-export: tar files with owner/group as root/root, LP: #371025
|
||||
* byobu, debian/install, motd+shell, profiles/byoburc: launch screen
|
||||
with a simple config file that includes the chosen profile plus
|
||||
|
@ -29,7 +30,10 @@ byobu (2.4) unreleased; urgency=low
|
|||
[ David Duffey ]
|
||||
* rpm/byobu.spec: initial specfile for RH packaging
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 16 May 2009 20:19:38 +0100
|
||||
[ Dustin Kirkland ]
|
||||
* -
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sat, 16 May 2009 20:35:23 +0100
|
||||
|
||||
byobu (2.3-0ubuntu1) karmic; urgency=low
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue