From 81a5a878b0125a92c3d50ba67d6e0d1e8387cf1f Mon Sep 17 00:00:00 2001 From: David-John Willis Date: Mon, 23 Nov 2009 09:45:36 +0000 Subject: [PATCH] pandora-scripts: Tweaks to helper scripts. --- recipes/pandora-system/pandora-scripts.bb | 7 +++-- .../pandora-scripts/op_cpuspeed.desktop | 4 +-- .../pandora-scripts/op_cpuspeed.sh | 30 ++++++++++++------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 51b8ae7..a466b21 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -3,7 +3,10 @@ LICENSE = "GPLV2" COMPATIBLE_MACHINE = "omap3-pandora" -PR = "r3" +DEPENDS = "zenity dbus" +RDEPENDS = "zenity dbus" + +PR = "r5" SRC_URI = " \ file://op_bright.sh \ @@ -23,4 +26,4 @@ do_install() { PACKAGE_ARCH = "${MACHINE_ARCH}" -FILES_${PN} += "${prefix} ${datadir}" \ No newline at end of file +FILES_${PN} += "${prefix} ${datadir}" diff --git a/recipes/pandora-system/pandora-scripts/op_cpuspeed.desktop b/recipes/pandora-system/pandora-scripts/op_cpuspeed.desktop index de6a9a9..611a692 100644 --- a/recipes/pandora-system/pandora-scripts/op_cpuspeed.desktop +++ b/recipes/pandora-system/pandora-scripts/op_cpuspeed.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=Set CPU speed -Comment=Under of overclock your pandoras cpu. +Comment=Under or overclock your OpenPandora CPU. StartupNotify=false -Exec=/usr/pandora/scripts/op_cpuclock.sh +Exec=/usr/pandora/scripts/op_cpuspeed.sh Icon=Terminal Terminal=false Type=Application diff --git a/recipes/pandora-system/pandora-scripts/op_cpuspeed.sh b/recipes/pandora-system/pandora-scripts/op_cpuspeed.sh index 94fad68..3f2c65b 100644 --- a/recipes/pandora-system/pandora-scripts/op_cpuspeed.sh +++ b/recipes/pandora-system/pandora-scripts/op_cpuspeed.sh @@ -1,24 +1,34 @@ #!/bin/bash #get value range -minmhz=100 +minmhz=14 safemhz=600 -maxmhz=900 +maxmhz=900 curmhz=$(cat /proc/pandora/cpu_mhz_max) device=/proc/pandora/cpu_mhz_max if [ ! $1 ]; then -newmhz=$(DISPLAY=0:0 zenity --scale --text "set cpu mhz" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1) + if [ $DISPLAY ]; then + newmhz=$(zenity --scale --text "set cpu mhz" --min-value=$minmhz --max-value=$maxmhz --value=$curmhz --step 1) + else + newmhz=$(read -p "Pleas enter the desired speed") + fi else newmhz=$1 fi if [ $newmhz ]; then - if [ $newmhz -ge $safemhz ]; then - 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 $?) - echo $answer - if [ $answer = 1 ]; then exit 1; fi - fi + if [ $newmhz -ge $safemhz ]; then + if [ $DISPLAY ]; then + answer=$(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 $?) + echo $answer + if [ $answer = 1 ]; then exit 1; fi + else + answer="n";read -p "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? [y/n]" -t 10 answer + echo $answer + if [ $answer = n ]; then exit 1; fi + fi + fi - if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi - if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi + if [ $newmhz -le $minmhz ]; then newmhz=$minmhz; fi + if [ $newmhz -ge $maxmhz ]; then newmhz=$maxmhz; fi fi echo $newmhz > $device echo cpu_mhz_max set to $(cat /proc/pandora/cpu_mhz_max) -- 2.39.2