slim-op-themes: Add custom OpenPandora SLiM themes.
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_cpuspeed.sh
1 #!/bin/bash
2 #get value range
3 minmhz=100
4 safemhz=600
5 maxmhz=900 
6 curmhz=$(cat /proc/pandora/cpu_mhz_max)
7 device=/proc/pandora/cpu_mhz_max
8 if [ ! $1 ]; then
9 newmhz=$(DISPLAY=0:0 zenity --scale --text "set cpu mhz" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1)
10 else
11 newmhz=$1
12 fi
13 if [ $newmhz ]; then
14         if [ $newmhz -ge $safemhz ]; then
15                 answer=$(DISPLAY=0:0 zenity --question --title "Alert" --text "You are trying to set the cpu clock to $newmhz which is above its specification of $safemhz, doing so may burn down your house, sour milk, or just blow up (ok, not that likely)! proceed?";echo $?)
16                 echo $answer
17                 if [ $answer = 1 ]; then exit 1; fi
18         fi
19  
20         if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi
21         if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi
22 fi
23 echo $newmhz > $device
24 echo cpu_mhz_max set to $(cat /proc/pandora/cpu_mhz_max)