#!/bin/bash # Change the CPU speed # set -x . /home/default PROGRAMS "cpufreq-set" # No need to change anything below # The parameters. TEXT="CPU Speed changer" #Check if dialog is installed type -P $DIALOG &>/dev/null || { echo "'$DIALOG' is required, but it's not installed. Aborting." >&2 exit 1; } #Program specific ### End parameters # Select the CPU speed $DIALOG --backtitle "$TEXT" \ --title "Speed selector" \ --menu "Please select one of the programs to run" 15 60 30 \ conservative "" \ userspace "" \ powersave "" \ ondemand "" \ performance "" \ 2> $TMP #Run the command if possible KEY=$? CHOICE=`cat $TMP` clear case $KEY in 0) COUNT=`cat /proc/cpuinfo | grep processor | wc -l` COUNT=`expr $COUNT \- 1` for CPU in `seq 0 $COUNT` do sudo /usr/bin/cpufreq-set -c${CHOICE} -g $SPEED done echo "Speed is changed to $CHOICE" ;; 1) echo "Cancel selected";; 2) echo "Help selected";; 255) echo "ESC selected";; esac # # exit