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

Damyan Ivanov dmn at debian.org
Tue Sep 2 12:17:20 UTC 2008


The following commit has been merged in the master branch:
commit b9c535af0ea1201277ca3e7f4e631c0c5d2f4d39
Author: Damyan Ivanov <dmn at debian.org>
Date:   Tue Sep 2 15:15:09 2008 +0300

    functions.sh: add support for toggling the camera

diff --git a/functions.sh b/functions.sh
index 08d89bd..972a927 100644
--- a/functions.sh
+++ b/functions.sh
@@ -68,3 +68,29 @@ toggle_bluetooth()
         fi
     fi
 }
+
+CAM_CTL=/sys/devices/platform/eeepc/camera
+# 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