Skip to content

Commit

Permalink
Comparing the content of the file
Browse files Browse the repository at this point in the history
intel_pstate/staus to make sure the condition only applies when "active"
  • Loading branch information
FosRexx committed Apr 28, 2024
1 parent 828db0e commit 26285b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def set_performance():
run(f"cpufreqctl.auto-cpufreq --epp --set={epp}", shell=True)
print(f'Setting to use: "{epp}" EPP')
else:
if Path("/sys/devices/system/cpu/intel_pstate/status").exists() is True:
if Path("/sys/devices/system/cpu/intel_pstate/status").exists() and open("/sys/devices/system/cpu/intel_pstate/status", 'r').read().strip() == "active":
run("cpufreqctl.auto-cpufreq --epp --set=performance", shell=True)
print('Setting to use: "performance" EPP')
else:
Expand Down

0 comments on commit 26285b7

Please sign in to comment.