I pushed my luck further.
Now battery percentage is in white text when charging, yellow text when discharging.
The State display is now white when charging, yellow when discharging.
Time til full is always white
The time remaining text is yellow from 100-36% battery pwr, orange from 35-16% battery pwr, and red from 15%-0%
Code: Select all
conky.text = [[
#leet chars: ┤┤└ └ ┴ ┴ ┐┐│ │┘ ┘┌ ┌ ├ ├ ┬ ┬ ┼ ┼ ┴ ┴ ── ││ ▽▼△▲▵▴▾▿
${alignr}${voffset 16}${offset -216}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Charging"}${color1}${exec acpi | grep "Battery 0" | awk '{print $4}'}${battery_percent BAT0}%${endif}
${alignr}${voffset -13}${offset -216}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Discharging"}${color2}${exec acpi | grep "Battery 0" | awk '{print $4}'}${battery_percent BAT0}%${endif}
${alignr}${offset -170}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Charging"}${color1}${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state" | awk '{$1=$1; print}'}${endif}
${alignr}${offset -170}${voffset -14}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Discharging"}${color2}${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state" | awk '{$1=$1; print}'}${endif}
${alignr}${offset -72}${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "to\ full"}
${alignr}${offset -156}${voffset -20}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Discharging"}${if_match ${battery_percent BAT0} >= 36}${color2}remaining: ${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | awk '{print $4" "$5}'}${endif}${endif}
${alignr}${offset -156}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Discharging"}${if_match ${battery_percent BAT0} <=35}${if_match ${battery_percent BAT0} >=16} ${color3}remaining: ${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | awk '{print $4" "$5}'}${endif}${endif}${endif}
${alignr}${offset -156}${voffset -20}${if_match "${exec cat /sys/class/power_supply/BAT0/status}" == "Discharging"}${if_match ${battery_percent BAT0} <=15} ${color4}remaining: ${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "time to empty" | awk '{print $4" "$5}'}${endif}${endif}
]];