DEPENDS = "zenity dbus"
RDEPENDS = "zenity dbus"
-PR = "r1"
+PR = "r2"
SRC_URI = " \
file://op_bright.sh \
file://op_bright.desktop \
file://op_cpuspeed.sh \
file://op_cpuspeed.desktop \
+ file://op_wifi.sh \
+ file://op_wifi.desktop \
+ file://op_bluetooth.sh \
+ file://op_bluetooth.desktop \
"
do_install() {
install -d ${D}${prefix}/pandora/scripts/
install -m 0755 ${WORKDIR}/op_bright.sh ${D}${prefix}/pandora/scripts/
- install -m 0755 ${WORKDIR}/op_cpuspeed.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_cpuspeed.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_wifi.sh ${D}${prefix}/pandora/scripts/
+ install -m 0755 ${WORKDIR}/op_bluetooth.sh ${D}${prefix}/pandora/scripts/
install -d ${D}${datadir}/applications/
install -m 0644 ${WORKDIR}/op_bright.desktop ${D}${datadir}/applications/
- install -m 0644 ${WORKDIR}/op_cpuspeed.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_cpuspeed.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_wifi.desktop ${D}${datadir}/applications/
+ install -m 0644 ${WORKDIR}/op_bluetooth.desktop ${D}${datadir}/applications/
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
--- /dev/null
+[Desktop Entry]
+Name=Toggle Bluetooth
+Comment=Toggle the status of your Bluetooth device.
+StartupNotify=false
+Exec=/usr/pandora/scripts/op_bluetooth.sh
+Icon=Terminal
+Terminal=false
+Type=Application
+Categories=System;
--- /dev/null
+#!/bin/sh
+#
+# Released under the GPL
+
+SILENT=0
+while getopts s opt
+do
+ case "$opt" in
+ s) SILENT=1;;
+ esac
+done
+
+INTERFACE=`hciconfig | grep "^hci" | cut -d ':' -f 1`
+pgrep bluetoothd
+if [ $? = 1 ]; then
+ notify-send "Bluetooth" "The bluetooth interface is being set up..." -i /usr/share/icons/hicolor/32x32/apps/st_bluetooth.png
+ sudo /usr/sbin/hciconfig ${INTERFACE} down
+ sudo /usr/sbin/hciconfig ${INTERFACE} up pscan
+ sudo /usr/sbin/bluetoothd
+fi
+
+if [ ${SILENT} = 0 ]; then
+ bluetooth-wizard
+fi
--- /dev/null
+[Desktop Entry]
+Name=Toggle WiFi
+Comment=Toggle the status of the WiFi chip.
+StartupNotify=false
+Exec=/usr/pandora/scripts/op_wifi.sh
+Icon=Terminal
+Terminal=false
+Type=Application
+Categories=System;
--- /dev/null
+#!/bin/bash
+#get value range
+minmhz=14
+safemhz=600
+maxmhz=900
+curmhz=$(cat /proc/pandora/cpu_mhz_max)
+device=/proc/pandora/cpu_mhz_max
+if [ ! $1 ]; then
+ 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
+ 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
+fi
+echo $newmhz > $device
+echo cpu_mhz_max set to $(cat /proc/pandora/cpu_mhz_max)