diff options
| author | Rayeshman <rayeshman@riseup.net> | 2014-05-26 12:39:41 +0430 |
|---|---|---|
| committer | Rayeshman <rayeshman@riseup.net> | 2014-05-26 12:39:41 +0430 |
| commit | c3721c7cffa06e26023199a8c1328ac67f3bd414 (patch) | |
| tree | a138851d228ef7e5b784cc21dc2707b7a0da9b22 /modules/sysdata.py | |
| parent | 943412cf34e81debe647af4329e996d77df6e0b9 (diff) | |
CPU temp optional!
Diffstat (limited to 'modules/sysdata.py')
| -rw-r--r-- | modules/sysdata.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/sysdata.py b/modules/sysdata.py index bd81b5e..5354fce 100644 --- a/modules/sysdata.py +++ b/modules/sysdata.py @@ -8,6 +8,10 @@ # i3wm homepage: http://i3wm.org # py3status homepage: https://github.com/ultrabug/py3status +# NOTE: If you want py3status to show you your CPU temperature, change value of CPUTEMP into True +# in Py3status class - CPUInfo function +# and REMEMBER that you must install lm_sensors if you want CPU temp! + # Copyright (C) <2013> <Shahin Azad [ishahinism at Gmail]> # This program is free software: you can redistribute it and/or modify @@ -110,9 +114,13 @@ class Py3status: else: response['color'] = i3status_config['color_bad'] #cpu temp - cputemp=subprocess.check_output('sensors | grep "CPU Temp" | cut -f 2 -d "+" | cut -f 1 -d " "',shell=True) - cputemp=cputemp[:-1].decode('utf-8') - response['full_text'] = "CPU: %.2f%%" % (used_cpu_percent*100) +" "+cputemp + CPUTEMP=False + if CPUTEMP: + cputemp=subprocess.check_output('sensors | grep "CPU Temp" | cut -f 2 -d "+" | cut -f 1 -d " "',shell=True) + cputemp=cputemp[:-1].decode('utf-8') + response['full_text'] = "CPU: %.2f%%" % (used_cpu_percent*100) +" "+cputemp + else: + response['full_text'] = "CPU: %.2f%%" % (used_cpu_percent*100) #cache the status for 10 seconds response['cached_until'] = time() + 10 |
