From b151106ce0b77ebcd79426c693d2d4f118966527 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 1 Jan 2015 20:46:32 +0100 Subject: Added discharge rate display to conky battery section * this is only displayed when actually discharging, data is provided by `upower` --- conky/.conkyrc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'conky/.conkyrc') diff --git a/conky/.conkyrc b/conky/.conkyrc index bc52864..03bbae4 100644 --- a/conky/.conkyrc +++ b/conky/.conkyrc @@ -1,6 +1,6 @@ out_to_x no out_to_console yes -update_interval 5 +update_interval 5 if_up_strictness address @@ -87,10 +87,21 @@ TEXT "full_text" : " Battery",\ "separator" : false\ },\ + ${if_match "${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | pcregrep -o1 '^[ ]*state:[ ]*([\w]+)'}" == "discharging"}\ + {\ + "full_text" : "${battery_percent}",\ + "color" : "\#909737",\ + "separator" : false\ + },\ + {\ + "full_text" : "(${exec upower -i /org/freedesktop/UPower/devices/battery_BAT0 | pcregrep -o1 '^[ ]*energy.rate:[ ]*([\S]{1,4})'}W) "\ + },\ + ${else}\ {\ "full_text" : "${battery_percent} ",\ "color" : "\#909737"\ },\ + ${endif}\ {\ "full_text" : " ${time %Y/%m/%d}",\ "separator" : false\ -- cgit v1.2.3