hoome

CPUFreqFace - Little interface for CPU clock control

Aug 11th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. #!/bin/bash
  2. # CPUFreq YAD Interface
  3. # Made by Artur 'hoOmE' Paiva <[email protected]>
  4. # Under LGPLv3
  5. # Verifica se o YAD Existe mesmo.
  6. here=$(dirname $0)
  7. if [ "$(yad --version 2>/dev/null)" = "$null" ]; then
  8.     echo "YAD isnt installed, but GameVision needs YAD"
  9.     exit 1
  10. fi
  11.  
  12. # Subrotina para trocar o governator de todos os nucleos
  13. changeto() {
  14.     sudo cpupower frequency-set -g $1
  15. }
  16.  
  17. # A Tela principal
  18. while [ "$resposta" != "252" ]; do
  19. yad --button="OnDemand":0 --button="Performance":1 --button="PowerSave":3 --button="gtk-close":252 --center --image="cpu" --title="Accelerometer" --text="Current Speed: $($here/getclock.sh) - Current Governator: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)" --sticky --undecorated --on-top --skip-taskbar --geometry=0x0+0+0
  20.     resposta=$?
  21.     if [ "$resposta" = "0" ]; then
  22.         changeto ondemand
  23.     elif [ "$resposta" = "1" ]; then
  24.         changeto performance
  25.     elif [ "$resposta" = "2" ]; then
  26.         changeto conservative
  27.     elif [ "$resposta" = "3" ]; then
  28.         changeto powersave
  29.     fi
  30. done
Advertisement
Add Comment
Please, Sign In to add comment