[Debian-eeepc-commits] [SCM] A live-helper based Debian live & installer image for the Eee PC. branch, master, updated. 1.0b1-16-gcd883d4

Ben Armstrong synrg at debian.org
Sat Jul 25 19:22:56 UTC 2009


The following commit has been merged in the master branch:
commit cd883d4e96d356bba06be766d49eb7f9a07b7802
Author: Ben Armstrong <synrg at debian.org>
Date:   Sat Jul 25 16:22:43 2009 -0300

    Add zenity-dialog driven webcam demo & icon for it on lxpanel

diff --git a/Changelog b/Changelog
index b1db25b..8c06c96 100644
--- a/Changelog
+++ b/Changelog
@@ -20,6 +20,8 @@
  * Configure ayttm to autojoin #debian-eeepc.
  * Rebuild against panthera's 2.6.30 kernel backport.
  * Include non-free firmware-ralink for rt2860.
+ * Add zenity for some demo dialogs.
+ * Add webcam demo.
 
 1.0~b2
 ------
diff --git a/config/chroot_local-includes/etc/skel/.config/lxpanel/LXDE/panels/panel b/config/chroot_local-includes/etc/skel/.config/lxpanel/LXDE/panels/panel
index 9514448..178bd07 100644
--- a/config/chroot_local-includes/etc/skel/.config/lxpanel/LXDE/panels/panel
+++ b/config/chroot_local-includes/etc/skel/.config/lxpanel/LXDE/panels/panel
@@ -58,6 +58,9 @@ Plugin {
         Button {
             id=lxde-x-www-browser.desktop
         }
+        Button {
+            id=webcam_demo.desktop
+        }
     }
 }
 
diff --git a/config/chroot_local-includes/usr/local/bin/webcam_demo b/config/chroot_local-includes/usr/local/bin/webcam_demo
new file mode 100755
index 0000000..b2ba421
--- /dev/null
+++ b/config/chroot_local-includes/usr/local/bin/webcam_demo
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+CAMCTL=/sys/devices/platform/eeepc/camera
+
+enable_camera () {
+	sudo sh -c "echo 1 > $CAMCTL"
+	sudo modprobe -r uvcvideo
+	sudo modprobe uvcvideo
+	TIMEOUT=50
+	PASSED=0
+	VIDEO_DEV=/dev/video0
+
+	while [ ! -e $VIDEO_DEV ] && [ $PASSED -le $TIMEOUT ]; do
+	    sleep 0.1
+	    PASSED=$(( $PASSED + 1 ))
+	done
+}
+
+disable_camera () {
+	sudo sh -c "echo 0 > $CAMCTL"
+}
+
+if [ $(cat $CAMCTL) -eq 0 ]; then
+	state=off
+else
+	state=on
+fi
+
+action=`zenity --list --radiolist  --column "" --column "" --column "Camera" \
+	--hide-column 2 --height 226 \
+	TRUE 1 "Enable camera and run demo" \
+	FALSE 2 "Enable camera and exit" \
+	FALSE 3 "Disable camera and exit" \
+	--text "Your webcam is ${state}.\nSelect desired action and press OK or\npress Cancel to exit with no changes"`
+
+case "$action" in
+1)
+	if [ "$state" = "off" ]; then enable_camera; fi
+	mplayer -fps 30 -vf screenshot tv://
+	;;
+2)
+	if [ "$state" = "off" ]; then enable_camera; fi
+	;;
+3)
+	if [ "$state" = "on" ]; then disable_camera; fi
+	;;
+esac
+
diff --git a/config/chroot_local-includes/usr/local/share/applications/webcam_demo.desktop b/config/chroot_local-includes/usr/local/share/applications/webcam_demo.desktop
new file mode 100644
index 0000000..ae39dd7
--- /dev/null
+++ b/config/chroot_local-includes/usr/local/share/applications/webcam_demo.desktop
@@ -0,0 +1,10 @@
+
+[Desktop Entry]
+Name=Camera
+GenericName=Camera
+Comment=Camera
+Icon=camera-web
+Exec=/usr/local/bin/webcam_demo
+Terminal=false
+Type=Application
+Categories=
diff --git a/config/chroot_local-packageslists/eeepc b/config/chroot_local-packageslists/eeepc
index a517d78..c55e0ab 100644
--- a/config/chroot_local-packageslists/eeepc
+++ b/config/chroot_local-packageslists/eeepc
@@ -5,4 +5,4 @@ menu nano libgl1-mesa-dri bash-completion
 lxde dhcp3-client wicd aosd-cat hal iceweasel alsa-base alsa-utils
 ayttm mplayer mozilla-noscript
 gksu synaptic cpufrequtils acpi gparted netcat wget aptitude
-iputils-ping less ssh-client clive briquolo
+iputils-ping less ssh-client clive briquolo zenity

-- 
A live-helper based Debian live & installer image for the Eee PC.



More information about the Debian-eeepc-commits mailing list