[Debian-eeepc-devel] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 6742528e5492fed9adff8cb50935b08123ee9405

Damyan Ivanov dmn at debian.org
Sun Sep 7 11:25:58 UTC 2008


The following commit has been merged in the master branch:
commit 105c82ab7e6f9f0cdb5a8592ab62ebfd570f877e
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sun Sep 7 12:54:12 2008 +0300

    move camera support from functions.sh to etc/acpi/lib/camera.sh
    
    conffiles are better for keeping user customizations

diff --git a/actions/hotkey.sh b/actions/hotkey.sh
index db77541..0111707 100755
--- a/actions/hotkey.sh
+++ b/actions/hotkey.sh
@@ -103,6 +103,7 @@ show_camera() {
 }
 
 handle_camera_toggle() {
+    . /etc/acpi/lib/camera.sh
     if [ -e $CAM_CTL ]; then
 	toggle_camera
 	show_camera
diff --git a/functions.sh b/functions.sh
index d7915e2..cb59333 100644
--- a/functions.sh
+++ b/functions.sh
@@ -35,30 +35,3 @@ detect_x_display()
         home=$_home
     fi
 }
-
-CAM_CTL=/sys/devices/platform/eeepc/camera
-[ -e $CAM_CTL ] || CAM_CTL=/proc/acpi/asus/camera #pre-2.6.26
-# check if camera is enabled and return success (exit code 0 if it is
-# return failure (exit code 1) if it is not
-#
-# uses the acpi platform driver interface if that is available
-# if not, assume there is not camera and return false
-camera_is_on()
-{
-    if [ -e $CAM_CTL ]; then
-        [ $( cat $CAM_CTL ) = "1" ]
-    else
-        false
-    fi
-}
-
-toggle_camera()
-{
-    if camera_is_on; then
-        echo 0 > $CAM_CTL
-    else
-        if [ -e $CAM_CTL ]; then
-            echo 1 > $CAM_CTL
-        fi
-    fi
-}
diff --git a/lib/camera.sh b/lib/camera.sh
new file mode 100644
index 0000000..1aab001
--- /dev/null
+++ b/lib/camera.sh
@@ -0,0 +1,31 @@
+# shell library for handling builtin cameera of Assu EeePC
+#
+# to be sourced
+
+CAM_CTL=/sys/devices/platform/eeepc/camera
+[ -e $CAM_CTL ] || CAM_CTL=/proc/acpi/asus/camera #pre-2.6.26
+# check if camera is enabled and return success (exit code 0 if it is
+# return failure (exit code 1) if it is not
+#
+# uses the acpi platform driver interface if that is available
+# if not, assume there is not camera and return false
+camera_is_on()
+{
+    if [ -e $CAM_CTL ]; then
+        [ $( cat $CAM_CTL ) = "1" ]
+    else
+        false
+    fi
+}
+
+toggle_camera()
+{
+    if camera_is_on; then
+        echo 0 > $CAM_CTL
+    else
+        if [ -e $CAM_CTL ]; then
+            echo 1 > $CAM_CTL
+        fi
+    fi
+}
+

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-devel mailing list