Switch between battery charging/not icons
This commit is contained in:
parent
b5c2f8343a
commit
41cb522d2c
@ -24,11 +24,18 @@ fi
|
||||
|
||||
if [ "`acpi -b`" != "No support for device type: power_supply" ]; then
|
||||
function get_battery {
|
||||
acpi -b | \
|
||||
awk '{ print $4 }' | \
|
||||
awk '$battery ~ /.*/ {
|
||||
local output=$(acpi -b)
|
||||
local charging=$(echo $output | awk '{ print $3 }')
|
||||
local percentage=$(echo $output | awk '{ print $4 }')
|
||||
if [ "$charging" = "Charging," ];then
|
||||
echo $percentage | awk '$battery ~ /.*/ {
|
||||
printf "%3d%% %s\n", $battery, substr("", int($battery / 9), 1)
|
||||
}'
|
||||
else
|
||||
echo $percentage | awk '$battery ~ /.*/ {
|
||||
printf "%3d%% %s\n", $battery, substr("", int($battery / 9), 1)
|
||||
}'
|
||||
fi
|
||||
}
|
||||
else
|
||||
function get_battery {
|
||||
|
Loading…
x
Reference in New Issue
Block a user