mirror of
https://github.com/TECHNOFAB11/tmux2k.git
synced 2025-12-11 23:50:08 +01:00
fix: macos battery percentage
This commit is contained in:
parent
e37451256c
commit
129a370ffd
1 changed files with 3 additions and 4 deletions
|
|
@ -44,7 +44,7 @@ battery_percent() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Darwin)
|
Darwin)
|
||||||
echo $(pmset -g batt | grep -Eo '[0-9]?[0-9]?[0-9]%')
|
echo $(pmset -g batt | grep -Eo '[0-9]?[0-9]?[0-9]%' | sed 's/%//g')
|
||||||
;;
|
;;
|
||||||
|
|
||||||
FreeBSD)
|
FreeBSD)
|
||||||
|
|
@ -122,14 +122,13 @@ main() {
|
||||||
bat_perc=$(battery_percent)
|
bat_perc=$(battery_percent)
|
||||||
bat_label=$(get_tmux_option "@tmux2k-battery-label" "$(battery_label "$bat_perc")")
|
bat_label=$(get_tmux_option "@tmux2k-battery-label" "$(battery_label "$bat_perc")")
|
||||||
|
|
||||||
if [ -z "$bat_stat" ]; then # Test if status is empty or not
|
if [ -z "$bat_stat" ]; then
|
||||||
echo "$bat_label $bat_perc%"
|
echo "$bat_label $bat_perc%"
|
||||||
elif [ -z "$bat_perc" ]; then # In case it is a desktop with no battery percent, only AC power
|
elif [ -z "$bat_perc" ]; then
|
||||||
echo "$bat_stat $bat_label"
|
echo "$bat_stat $bat_label"
|
||||||
else
|
else
|
||||||
echo "$bat_stat $bat_label $bat_perc%"
|
echo "$bat_stat $bat_label $bat_perc%"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#run main driver program
|
|
||||||
main
|
main
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue