From 38a8c0710bbafb3dfba2890c0fa34807af4801ea Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Fri, 2 Mar 2018 01:50:57 +0100 Subject: [PATCH] config: barpyrus: config.py: add colorized cpu temperature to conky Adds cpu temperature to the conky configuration of barpyrus. If the temperature has reached a specific value, change the color. if temp <= 50: blue else if temp <= 70: orange else: red --- config/barpyrus/config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/config/barpyrus/config.py b/config/barpyrus/config.py index 48aa9f9..8611109 100644 --- a/config/barpyrus/config.py +++ b/config/barpyrus/config.py @@ -53,8 +53,20 @@ def conky_icon(icon_code, icon_color, text_color = 'lightgrey'): return text # conky specific configuration +# cpu temperature +conky_text = '${if_match \"$acpitemp\" <= \"50\"}' +conky_text += conky_icon('\ue01b', 'lightblue') +conky_text += '${else}' +conky_text += '${if_match \"$acpitemp\" <= \"70\"}' +conky_text += conky_icon('\ue01b', 'orange') +conky_text += '${else}' +conky_text += conky_icon('\ue01b', 'red') +conky_text += '${endif}' +conky_text += '${endif}' +conky_text += '${acpitemp}°C ' + # cpu and memory load factor -conky_text = conky_icon('\ue026', 'green') + '${cpu}% ' +conky_text += conky_icon('\ue026', 'green') + '${cpu}% ' conky_text += conky_icon('\ue021', 'green') + '${memperc}% ' # options for hlwm.HLWMLayoutSwitcher widget