From: David-John Willis Date: Wed, 11 Nov 2009 14:36:29 +0000 (+0000) Subject: pandora-scripts: Add recipe to mop up small system support scripts that are handy... X-Git-Tag: Release-2010-05/1~175 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=285cc4c3bb32360f445cd3414b209903e80eaba4 pandora-scripts: Add recipe to mop up small system support scripts that are handy for the device. --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb new file mode 100644 index 0000000..9522afb --- /dev/null +++ b/recipes/pandora-system/pandora-scripts.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Scripts to support system options on the OpenPandora." +LICENSE = "GPLV2" +RDEPENDS = "zenity dbus" + +COMPATIBLE_MACHINE = "omap3-pandora" + +PR = "r0" + +SRC_URI = " \ + file://pnd_bright.sh \ + file://pnd_bright.desktop \ +" + +do_install() { + install -d ${D}${prefix}/pandora/scripts/ + install -m 0755 ${S}/pnd_bright.sh ${D}${prefix}/pandora/scripts/ + install -d ${D}${datadir}/applications/ + install -m 0644 ${S}/pnd_bright.desktop ${D}${datadir}/applications/ +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes/pandora-system/pandora-scripts/pnd_bright.desktop b/recipes/pandora-system/pandora-scripts/pnd_bright.desktop new file mode 100644 index 0000000..0b03d4b --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/pnd_bright.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Set Backlight Brightness +Comment=Set the brightness of the backlight. +StartupNotify=false +Exec=/usr/pandora/scripts/pnd_bright.sh +Icon=Terminal +Terminal=false +Type=Application +Categories=System; diff --git a/recipes/pandora-system/pandora-scripts/pnd_bright.sh b/recipes/pandora-system/pandora-scripts/pnd_bright.sh new file mode 100644 index 0000000..fbfa6f0 --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/pnd_bright.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#get value range +minbright=3 +maxbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness) +curbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness) +device=/sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness +if [ ! $1 ]; then +newbright=$(DISPLAY=0:0 zenity --scale --text "set brightness" --min-value=$minbright --max-value=$maxbright --value=$curbright --step 1) +else +newbright=$1 +fi +if [ $newbright -le $minbright ]; then newbright=$minbright; fi +if [ $newbright -ge $maxbright ]; then newbright=$maxbright; fi +echo $newbright > $device