Skip to content

Commit 267d960

Browse files
he8usmartinbeentjes
authored andcommitted
Allow to put colors in discharging icons (#60)
1 parent 215de6d commit 267d960

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/battery_icon.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ get_icon_settings() {
3636
charged_icon=$(get_tmux_option "@batt_charged_icon" "$(charged_default)")
3737
charging_icon=$(get_tmux_option "@batt_charging_icon" "$charging_default")
3838
attached_icon=$(get_tmux_option "@batt_attached_icon" "$attached_default")
39-
full_charge_icon=$(get_tmux_option "@batt_full_charge_icon" "$full_charge_icon_default")
40-
high_charge_icon=$(get_tmux_option "@batt_high_charge_icon" "$high_charge_icon_default")
41-
medium_charge_icon=$(get_tmux_option "@batt_medium_charge_icon" "$medium_charge_icon_default")
42-
low_charge_icon=$(get_tmux_option "@batt_low_charge_icon" "$low_charge_icon_default")
39+
full_charge_icon=$(get_tmux_option "@batt_full_charge_icon" "$full_charge_icon_default")
40+
high_charge_icon=$(get_tmux_option "@batt_high_charge_icon" "$high_charge_icon_default")
41+
medium_charge_icon=$(get_tmux_option "@batt_medium_charge_icon" "$medium_charge_icon_default")
42+
low_charge_icon=$(get_tmux_option "@batt_low_charge_icon" "$low_charge_icon_default")
4343
}
4444

4545
print_icon() {
@@ -52,15 +52,15 @@ print_icon() {
5252
# use code from the bg color
5353
percentage=$($CURRENT_DIR/battery_percentage.sh | sed -e 's/%//')
5454
if [ $percentage -eq 100 ]; then
55-
printf $full_charge_icon
55+
printf "$full_charge_icon"
5656
elif [ $percentage -le 99 -a $percentage -ge 51 ];then
57-
printf $high_charge_icon
57+
printf "$high_charge_icon"
5858
elif [ $percentage -le 50 -a $percentage -ge 16 ];then
59-
printf $medium_charge_icon
59+
printf "$medium_charge_icon"
6060
elif [ "$percentage" == "" ];then
61-
printf $full_charge_icon_default # assume it's a desktop
61+
printf "$full_charge_icon_default" # assume it's a desktop
6262
else
63-
printf $low_charge_icon
63+
printf "$low_charge_icon"
6464
fi
6565
elif [[ $status =~ (attached) ]]; then
6666
printf "$attached_icon"

0 commit comments

Comments
 (0)