Created
January 29, 2024 19:42
-
-
Save UndeadDevel/6847c10f091dd05f4d70f436070daf22 to your computer and use it in GitHub Desktop.
QubesOS: Switch between CPU governors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# valid values: 0-255, lower means more performance-leaning | |
PERF=24 | |
BAL=128 # don't modify this value without uncommenting the xenpm command below the first if-clause | |
PS=223 | |
CUR_VAL=$(xenpm get-cpufreq-para | grep -E -m 1 -o energy_perf\ \[[0-9]+\] | tr -dc '0-9') | |
if [ "$CUR_VAL" -lt "$BAL" ]; then | |
xenpm set-cpufreq-hwp balance | |
#xenpm set-cpufreq-hwp energy-perf:$BAL | |
notify-send "CPU: Balanced" | |
elif [ "$CUR_VAL" -eq "$BAL" ]; then | |
xenpm set-cpufreq-hwp energy-perf:$PS | |
notify-send "CPU: Power saving" | |
else | |
xenpm set-cpufreq-hwp energy-perf:$PERF | |
notify-send "CPU: Performance" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment