Subject: [PATCH] Enable the display of brightness, based on patch by Darren Salt <[email-masked]>

From: Raphael Geissert <[email-masked]>
Date: Thu, 29 Jan 2009 18:47:04 -0600

Signed-off-by: Raphael Geissert <[email-masked]>
---
 etc/acpi/actions/hotkey.sh |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/etc/acpi/actions/hotkey.sh b/etc/acpi/actions/hotkey.sh
index a574911..ba876a4 100755
--- a/etc/acpi/actions/hotkey.sh
+++ b/etc/acpi/actions/hotkey.sh
@@ -80,13 +80,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
@@ -130,6 +130,7 @@ case $code in
     # Fn+F4 -- increase brightness
     0000002?)
 	# actual brightness change is handled in hardware
+	show_brightness
 	;;
     0000001a)
 	# soft-buton 1