@@ -8,29 +8,35 @@ color_full_charge_default="#[bg=green]"
88color_high_charge_default=" #[bg=yellow]"
99color_medium_charge_default=" #[bg=colour208]" # orange
1010color_low_charge_default=" #[bg=red]"
11+ color_charging_default=" #[bg=green]"
1112
1213color_full_charge=" "
1314color_high_charge=" "
1415color_medium_charge=" "
1516color_low_charge=" "
17+ color_charging=" "
1618
1719get_charge_color_settings () {
1820 color_full_charge=$( get_tmux_option " @batt_color_full_charge" " $color_full_charge_default " )
1921 color_high_charge=$( get_tmux_option " @batt_color_high_charge" " $color_high_charge_default " )
2022 color_medium_charge=$( get_tmux_option " @batt_color_medium_charge" " $color_medium_charge_default " )
2123 color_low_charge=$( get_tmux_option " @batt_color_low_charge" " $color_low_charge_default " )
24+ color_charging=$( get_tmux_option " @batt_color_charging" " $color_charging_default " )
2225}
2326
2427print_battery_status_bg () {
2528 # Call `battery_percentage.sh`.
2629 percentage=$( $CURRENT_DIR /battery_percentage.sh | sed -e ' s/%//' )
27- if [ $percentage -eq 100 ]; then
30+ status=$( battery_status | awk ' {print $1;}' )
31+ if [ $status == ' charging' ]; then
32+ printf $color_charging
33+ elif [ $percentage -eq 100 ]; then
2834 printf $color_full_charge
2935 elif [ $percentage -le 99 -a $percentage -ge 51 ]; then
3036 printf $color_high_charge
3137 elif [ $percentage -le 50 -a $percentage -ge 16 ]; then
3238 printf $color_medium_charge
33- elif [ " $percentage " == " " ]; then
39+ elif [ " $percentage " == " " ]; then
3440 printf $color_full_charge_default # assume it's a desktop
3541 else
3642 printf $color_low_charge
0 commit comments