Merge pull request #183 from ibrokemypie/sensors
modules/sensors: Try intel scaling current frequency
This commit is contained in:
commit
83a8efd120
1 changed files with 7 additions and 3 deletions
|
@ -47,9 +47,13 @@ class Module(bumblebee.engine.Module):
|
||||||
return temperature
|
return temperature
|
||||||
|
|
||||||
def get_mhz( self ):
|
def get_mhz( self ):
|
||||||
output = open("/proc/cpuinfo").read()
|
try:
|
||||||
m = re.search(r"cpu MHz\s+:\s+(\d+)", output)
|
output = open("/sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq").read()
|
||||||
mhz = int(m.group(1))
|
mhz = int(float(output)/1000.0)
|
||||||
|
except:
|
||||||
|
output = open("/proc/cpuinfo").read()
|
||||||
|
m = re.search(r"cpu MHz\s+:\s+(\d+)", output)
|
||||||
|
mhz = int(m.group(1))
|
||||||
|
|
||||||
if mhz < 1000:
|
if mhz < 1000:
|
||||||
return "{} MHz".format(mhz)
|
return "{} MHz".format(mhz)
|
||||||
|
|
Loading…
Reference in a new issue