#!/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)"
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