This is just for me since my fan is broken
This commit is contained in:
parent
47378715d0
commit
bbbe0aaeb6
1 changed files with 14 additions and 0 deletions
14
vigil
14
vigil
|
|
@ -847,6 +847,19 @@ class Screen:
|
|||
({"w"}, toggle_watch_filesystem), ({"q"}, quit_)]
|
||||
|
||||
|
||||
def get_cpu_temperature():
|
||||
with open("/sys/class/thermal/thermal_zone0/temp", "r") as temp_file:
|
||||
return int(temp_file.read()[:-4])
|
||||
|
||||
|
||||
def regulate_temperature(log):
|
||||
if get_cpu_temperature() >= 72:
|
||||
log.log_message("The computer is too hot. Waiting to cool down...")
|
||||
while get_cpu_temperature() > 66:
|
||||
time.sleep(1)
|
||||
log.log_message("The computer has cooled down. Continuing...")
|
||||
|
||||
|
||||
class Runner:
|
||||
|
||||
def __init__(self):
|
||||
|
|
@ -858,6 +871,7 @@ class Runner:
|
|||
while True:
|
||||
jobs_added_event.wait()
|
||||
while self.is_running:
|
||||
# regulate_temperature(log) # My fan is broken
|
||||
try:
|
||||
self.result = summary.get_closest_placeholder()
|
||||
except StopIteration:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue