[Debian-eeepc-commits] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 0bd6ef1871653610ff1ed1f7cb3d5315b6821f6c

Darren Salt linux at youmustbejoking.demon.co.uk
Wed Feb 4 01:00:59 UTC 2009


The following commit has been merged in the master branch:
commit 0bd6ef1871653610ff1ed1f7cb3d5315b6821f6c
Author: Darren Salt <linux at youmustbejoking.demon.co.uk>
Date:   Wed Feb 4 00:23:07 2009 +0000

    Allow reporting via OSD of brightness changes.

diff --git a/debian/changelog b/debian/changelog
index a1e1efd..7f4cb71 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ eeepc-acpi-scripts (1.0.12) UNRELEASED; urgency=low
   * Ignore events when shutting down or rebooting.
   * Give immediate indication of pressing of Fn-F2.
   * The same ACPI key code may be used for wireless on as well as wireless off.
+  * Allow reporting via OSD of brightness changes.
 
   [ Raphael Geissert ]
   * Auto detect the playback devices and the playback switches
diff --git a/debian/eeepc-acpi-scripts.default b/debian/eeepc-acpi-scripts.default
index 0cd0f81..8068c2b 100644
--- a/debian/eeepc-acpi-scripts.default
+++ b/debian/eeepc-acpi-scripts.default
@@ -3,6 +3,10 @@
 ENABLE_OSD='no'
 OSD_FONT='DejaVuSans 36'
 
+# set this and ENABLE_OSD to yes if you want brightness changes via Fn-Fx to
+# be reported
+ENABLE_OSD_BRIGHTNESS='no'
+
 # Leave these empty to attempt to autoconfigure. If they don't work for you
 # lookup the following values by using amixer
 SOUND_LABEL=
diff --git a/etc/acpi/actions/hotkey.sh b/etc/acpi/actions/hotkey.sh
index e9f6234..cd8e347 100755
--- a/etc/acpi/actions/hotkey.sh
+++ b/etc/acpi/actions/hotkey.sh
@@ -86,13 +86,13 @@ handle_camera_toggle() {
     fi
 }
 
-#show_brightness() {
-#    # final digit of ACPI code is brightness level in hex
-#    level=0x${code:${#code}-1}
-#    # convert hex digit to percent
-#    percent=$(((100 * $level + 8) / 15))
-#    notify Brightness $percent
-#}
+show_brightness() {
+    # final digit of ACPI code is brightness level in hex
+    level=$((0x$code & 0xF))
+    # convert hex digit to percent
+    percent=$(((100 * $level + 8) / 15))
+    notify Brightness $percent
+}
 
 case $code in
     # Fn+F2 -- toggle wireless
@@ -138,6 +138,9 @@ case $code in
     # Fn+F4 -- increase brightness
     0000002?)
 	# actual brightness change is handled in hardware
+	if [ "x$ENABLE_OSD_BRIGHTNESS" != "xno" ]; then
+	  show_brightness
+	fi
 	;;
     0000001a)
 	# soft-buton 1

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-commits mailing list