Advertisement
metalx1000

Change Linux CPU Performance

Jan 15th, 2023
1,426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. sudo apt install fzf linux-cpupower
  2.  
  3. #Check current state
  4. cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  5.  
  6. #see avaliable states
  7. cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
  8.  
  9. #change current state
  10. echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  11.  
  12. fzgov() {
  13.   # Dependencies: fzf and kernel-tools
  14.   local ScalingGov=$(
  15.   printf '%s\0' $(</sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors) \
  16.     | fzf --prompt "Current CPU State is '$(</sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)'> " --read0
  17.   )
  18.   #[[ $ScalingGov ]] && sudo cpupower frequency-set -g "$ScalingGov"
  19.   [[ $ScalingGov ]] && echo "$ScalingGov"|sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
  20. }
  21.  
  22. alias performance="fzgov"
  23.  
  24.  
  25. #GUI
  26. sudo apt install cpupower-gui
  27. cpupower-gui
Tags: Linux
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement