Paste #270657

   
pasted on 10.09.2023 22:05
  • Edit to this paste
  • Print
  • Raw
  • Compare with paste
    #  
  • Toggle line numbers
  • Syntax highlighting  
Text paste
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os.path
import subprocess
import shlex
import time

if os.path.isfile('/tmp/signalS'):
	os.remove('/tmp/signalS')
	exit()
else:
	open('/tmp/signalS', "w").close()

while True:
	if os.path.isfile('/tmp/signalS'):
		subprocess.call(shlex.split('env DISPLAY=:0 sh /home/diver/Скрипты/sensors.sh'))
		with open('/tmp/mySensors') as crFh:
			sens = crFh.readline().strip('\n')
		if float(sens) >= 55:
			subprocess.call(shlex.split('cpupower frequency-set -g powersave -d 800MHz -u 800MHz'))
			time.sleep(1)
			print(sens)
		else:
			subprocess.call(shlex.split('cpupower frequency-set -g powersave -d 800MHz -u 4.0GHz'))
			time.sleep(1)
			print(sens)
	else:
		break
Add Comment
Author