So basically, I'm trying to make a battery bar that's colored based on the battery percentage. I've got a python script that makes the colors perfectly:
Code:
import os, sys
import string
def calccolor(percentage):
red = (100 - percentage) * 255 / 100
green = percentage * 255 / 100
print("${color %02x%02x00}") % (red, green)
if __name__ == "__main__":
percentage = sys.argv[1]
calccolor(int(percentage))
but I can't seem to figure out how to run it in Conky. Currently I have:
Code:
Battery: ${execpi 10 python ~/batcalc.py $battery_percent}$battery_bar$color
but that doesn't work since Conky doesn't parse the percentage. Any way I can make this work?