hal/tools hal-system-lcd-get-brightness, 1.4,
1.5 hal-system-lcd-set-brightness, 1.4, 1.5
Richard Hughes
hughsient at freedesktop.org
Sun Jan 29 09:07:56 PST 2006
Update of /cvs/hal/hal/tools
In directory gabe:/tmp/cvs-serv13945/tools
Modified Files:
hal-system-lcd-get-brightness hal-system-lcd-set-brightness
Log Message:
2006-01-29 Richard Hughes <richard at hughsie.com>
* doc/spec/hal-spec.xml.in, hald/linux2/acpi.c (laptop_panel_refresh), hald/linux/pmu.c (laptop_panel_refresh), tools/hal-system-lcd-get-brightness, tools/hal-system-lcd-set-brightness:
Rename acpi_method to access_method and HAL_PROP_LAPTOP_PANEL_ACPI_METHOD->HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD for the laptop_panel device.
This is required as the access method can now be "pmu" which is nothing to do with acpi. I'm not aware of this being used anywhere outside of HAL, so we should be okay changing the key name.
Index: hal-system-lcd-get-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-get-brightness,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hal-system-lcd-get-brightness 29 Jan 2006 15:51:39 -0000 1.4
+++ hal-system-lcd-get-brightness 29 Jan 2006 17:07:54 -0000 1.5
@@ -8,15 +8,13 @@
# (at your option) any later version.
# Check for environment variables
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "" ]; then
echo "Missing or empty environment variable(s)." >&2
echo "This script should be started by hald." >&2
exit 1
fi
-#FIXME: HAL_PROP_LAPTOP_PANEL_ACPI_METHOD should really be
-# HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD as now not just ACPI
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "pmu" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "pmu" ]; then
value="`./hal-system-power-pmu getlcd`"
if [ $? -ne 0 ]; then
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
@@ -32,26 +30,26 @@
exit 1
fi
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "toshiba" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "toshiba" ]; then
# cat /proc/acpi/toshiba/lcd
# brightness: 5
# brightness_levels: 8
value="`cat $HAL_PROP_LINUX_ACPI_PATH | grep brightness: | awk '{print $2;}'`"
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "asus" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "asus" ]; then
# cat /proc/acpi/asus/brn
# 5
value="`cat $HAL_PROP_LINUX_ACPI_PATH`"
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "panasonic" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "panasonic" ]; then
# cat /proc/acpi/pcc/brightness
# 5
value="`cat $HAL_PROP_LINUX_ACPI_PATH`"
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "ibm" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "ibm" ]; then
# cat /proc/acpi/ibm/brightness
# level: 5
# commands: up, down
# commands: level <level> (<level> is 0-7)
value="`cat $HAL_PROP_LINUX_ACPI_PATH | grep level: | awk '{print $2;}'`"
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "sony" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "sony" ]; then
# cat /proc/acpi/sony/brightness
# 5
value="`cat $HAL_PROP_LINUX_ACPI_PATH`"
Index: hal-system-lcd-set-brightness
===================================================================
RCS file: /cvs/hal/hal/tools/hal-system-lcd-set-brightness,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- hal-system-lcd-set-brightness 29 Jan 2006 15:51:39 -0000 1.4
+++ hal-system-lcd-set-brightness 29 Jan 2006 17:07:54 -0000 1.5
@@ -8,7 +8,7 @@
# (at your option) any later version.
# Check for environment variables
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "" ] ||
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "" ] ||
[ "$HAL_PROP_LAPTOP_PANEL_NUM_LEVELS" == "" ] ; then
echo "Missing or empty environment variable(s)." >&2
echo "This script should be started by hald." >&2
@@ -18,7 +18,7 @@
# read value for set brightness
read value
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "pmu" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "pmu" ]; then
./hal-system-power-pmu setlcd $value
if [ $? -ne 0 ]; then
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
@@ -41,22 +41,22 @@
exit 1
fi
-if [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "toshiba" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "toshiba" ]; then
# echo "brightness: {0..x}" >/proc/acpi/toshiba/lcd
echo "brightness: $value" > $HAL_PROP_LINUX_ACPI_PATH
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "asus" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "asus" ]; then
# echo {0..15} > /proc/acpi/asus/brn
# http://www.taupro.com/wiki/ChemBook/LCDdisplayPowerConfiguration
echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "panasonic" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "panasonic" ]; then
# echo {0..15} > /proc/acpi/pcc/brightness
# http://readlist.com/lists/vger.kernel.org/linux-kernel/7/36405.html
echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "ibm" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "ibm" ]; then
# echo "level {0..7}" > /proc/acpi/ibm/brightness
# http://ibm-acpi.sourceforge.net/README
echo "level $value" > $HAL_PROP_LINUX_ACPI_PATH
-elif [ "$HAL_PROP_LAPTOP_PANEL_ACPI_METHOD" == "sony" ]; then
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "sony" ]; then
# echo "{1..8}" > /proc/acpi/sony/brightness
# http://popies.net/sonypi/2.6-sony_acpi4.patch
echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
More information about the hal-commit
mailing list