pandora-scripts: preliminary DSP overclocking script
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_cpuspeed.sh
index 16a9a2e..3c2b84e 100755 (executable)
@@ -1,9 +1,10 @@
 #!/bin/bash
 #get value range
-minmhz="$(cat /etc/pandora/conf/cpu.conf | grep 'min:' | awk -F\: '{print $2}')"
-safemhz="$(cat /etc/pandora/conf/cpu.conf | grep 'safe:' | awk -F\: '{print $2}')"
-maxmhz="$(cat /etc/pandora/conf/cpu.conf | grep 'max:' | awk -F\: '{print $2}')"
-warn="$(cat /etc/pandora/conf/cpu.conf | grep 'warn:' | awk -F\: '{print $2}')"
+cpu_conf=/etc/pandora/conf/cpu.conf
+minmhz="$(grep '^min:' $cpu_conf | awk -F\: '{print $2}')"
+safemhz="$(grep '^safe:' $cpu_conf | awk -F\: '{print $2}')"
+maxmhz="$(grep '^max:' $cpu_conf | awk -F\: '{print $2}')"
+warn="$(grep '^warn:' $cpu_conf | awk -F\: '{print $2}')"
 device=/proc/pandora/cpu_mhz_max
 curmhz="$(cat $device)"
 newmhz="$(cat $device)"
@@ -27,7 +28,7 @@ fi
 
 if [ ! $1 ]; then
        if [ $DISPLAY ]; then
-               newmhz=$(zenity --scale --text "Set CPU clockspeed" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
+               newmhz=$(zenity --scale --title "CPU clockspeed" --text "Set CPU clockspeed" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
        else
                read -p "Please enter the desired clockspeed: " newmhz
        fi