Created
August 13, 2023 22:30
-
-
Save reasonset/51d5b63e32462d9998a19b2b7c356299 to your computer and use it in GitHub Desktop.
Quick change CPU governor from systray.
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/zsh | |
SUDO_COMMAND=pkexec | |
#SUDO_COMMAND=gksu | |
#SUDO_COMMAND=kdesu | |
avilable_governors=($(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors)) | |
#avilable_governors=(powersave performance) | |
#avilable_governors=(powersave schedutil performance) | |
governors=() | |
for i in $avilable_governors | |
do | |
governors+=("$i"'!'"$SUDO_COMMAND"' cpupower frequency-set -g '"$i") | |
done | |
MENU_COMMAND="${(j:|:)governors}" | |
yad --notification --image="cpu" --menu="$MENU_COMMAND" --command="zsh -c 'notify-send \$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment