tmuxrc: improve battery indication
This commit is contained in:
parent
93bcfe9f9c
commit
adcab9d77f
@ -7,5 +7,5 @@ set -e
|
||||
if [ $(uname -s) = "Darwin" ]; then
|
||||
echo "" # TODO
|
||||
else # Linux
|
||||
echo "$(cat /sys/class/power_supply/BAT0/capacity)%"
|
||||
echo "$(cat /sys/class/power_supply/BAT0/capacity)"
|
||||
fi
|
||||
|
15
script/tmbatinfo
Executable file
15
script/tmbatinfo
Executable file
@ -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…
x
Reference in New Issue
Block a user