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
|
if [ "`acpi -b`" != "No support for device type: power_supply" ]; then
|
||||||
function get_battery {
|
function get_battery {
|
||||||
acpi -b | \
|
local output=$(acpi -b)
|
||||||
awk '{ print $4 }' | \
|
local charging=$(echo $output | awk '{ print $3 }')
|
||||||
awk '$battery ~ /.*/ {
|
local percentage=$(echo $output | awk '{ print $4 }')
|
||||||
printf "%3d%% %s\n", $battery, substr("", int($battery / 9), 1)
|
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
|
else
|
||||||
function get_battery {
|
function get_battery {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user