tmuxrc: improve battery indication
This commit is contained in:
parent
93bcfe9f9c
commit
adcab9d77f
|
@ -7,5 +7,5 @@ set -e
|
||||||
if [ $(uname -s) = "Darwin" ]; then
|
if [ $(uname -s) = "Darwin" ]; then
|
||||||
echo "" # TODO
|
echo "" # TODO
|
||||||
else # Linux
|
else # Linux
|
||||||
echo "$(cat /sys/class/power_supply/BAT0/capacity)%"
|
echo "$(cat /sys/class/power_supply/BAT0/capacity)"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Print battery percentage to stdout
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pc=$(batinfo)
|
||||||
|
|
||||||
|
if [ "$pc" -gt 40 ]; then
|
||||||
|
echo "#[fg=black, bg=green] $(batinfo)% #[default]"
|
||||||
|
elif [ "$pc" -gt 10 ]; then
|
||||||
|
echo "#[fg=black, bg=yellow] $(batinfo)% #[default]"
|
||||||
|
else
|
||||||
|
echo "#[fg=black, bg=red] $(batinfo)% #[default]"
|
||||||
|
fi
|
Loading…
Reference in New Issue