feat: cpu frequency control bind

This commit is contained in:
2025-07-11 14:05:41 +03:00
parent 864edb76bd
commit 0fb10b7842
5 changed files with 63 additions and 7 deletions

38
hypr/scripts/cpufreq.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
CURRENT=$(sudo cpupower frequency-info | grep 'current policy: frequency should be within 400 MHz and' | awk '{printf "%.2f%s", $10, substr($11, 1, length($11)-1)}')
echo Current freq is $CURRENT
set_cmd() {
sudo cpupower frequency-set --max $1MHz
notify-send -t 800 "$1MHz CPU Power"
}
if [ $CURRENT = "400.00MHz" ]; then
set_cmd 600
exit 0
fi
if [ $CURRENT = "600.00MHz" ]; then
set_cmd 1000
exit 0
fi
if [ $CURRENT = "1000.00MHz" ]; then
set_cmd 2000
exit 0
fi
if [ $CURRENT = "2.00GHz" ]; then
set_cmd 4200
exit 0
fi
if [ $CURRENT = "4.20GHz" ]; then
set_cmd 400
exit 0
fi
notify-send CPU-Power Error: value is $CURRENT
exit 1