i3 / i3status

Generates status bar to use with i3bar, dzen2 or xmobar
BSD 3-Clause "New" or "Revised" License
602 stars 254 forks source link

Custom battery `%emptytime` string when battery is full #479

Open riazufila opened 2 years ago

riazufila commented 2 years ago

Allow a custom string return for %emptytime for when battery is full. The custom string can be set from the config file in battery module with the option battery_full_emptytime.

Current behavior of %emptytime when battery is full is as below.

image

battery all {
        format = "<span background='#458588'> %percentage %status (while != %emptytime) </span>"
        low_threshold = 30
        threshold_type = "percentage"
}

Instead, with this PR, when battery is full, the battery module will display such as below. Of course, the value for battery_full_emptytime can be changed into any other string aside from "false".

image

battery all {
        format = "<span background='#458588'> %percentage %status (while != %emptytime) </span>"
        low_threshold = 30
        threshold_type = "percentage"
        battery_full_emptytime = "false"
}
riazufila commented 2 years ago

This PR is made to entertain #477.