View Single Post
Posts: 188 | Thanked: 90 times | Joined on Sep 2006
#7
rzr, are you in the right thread..?

Anyway, I modified things as such:
added this line to /usr/bin/lockscreenquotes.sh
lshal | grep battery.charge_level.percentage | awk '{print $3}' > /home/user/lsq/batterylevel.txt
(note: I used the dir lsq for the user stuff)


and these to the python script somewhere at the top:

# read batterylevel from file
file = open("batterylevel.txt")
BATTERYLEVEL = int(file.readline())
file.close()



#BATTERYLEVEL colour change
if BATTERYLEVEL < 10:
FONT_COLOR = (255, 0, 0)
elif BATTERYLEVEL < 20:
FONT_COLOR = (255, 255, 0)
elif BATTERYLEVEL < 50:
FONT_COLOR = (0, 255, 0)
elif BATTERYLEVEL < 90:
FONT_COLOR = (0, 255, 255)
else:
FONT_COLOR = (255, 255, 255)
__________________
If I said something useful, please hit the 'Thanks!' link related to that post.
 

The Following User Says Thank You to aRTee For This Useful Post: