[Debian-live-changes] r1520 - dists/trunk/live-helper/examples

matth-guest at alioth.debian.org matth-guest at alioth.debian.org
Wed May 16 23:39:55 UTC 2007


Author: matth-guest
Date: 2007-05-16 23:39:55 +0000 (Wed, 16 May 2007)
New Revision: 1520

Modified:
   dists/trunk/live-helper/examples/beryl-hook.sh
Log:
autostart beryl upon glxinfo return code


Modified: dists/trunk/live-helper/examples/beryl-hook.sh
===================================================================
--- dists/trunk/live-helper/examples/beryl-hook.sh	2007-05-16 22:10:56 UTC (rev 1519)
+++ dists/trunk/live-helper/examples/beryl-hook.sh	2007-05-16 23:39:55 UTC (rev 1520)
@@ -1,10 +1,11 @@
 #!/bin/sh
 
-# This is a hook for live-helper(7) to install beryl and enable aixgl.
+# This is a hook for live-helper(7) to install beryl and enable aiglx.
 # It was originally written by Inigo Tejedor Arrondo <inigo at navarrux.org>.
 #
 # To enable it, copy this hook into your config/chroot_localhooks directory.
-# At boot prompt, type 'live aixgl', press enter and have fun.
+# for forcing aiglx activation type at boot prompt "live forceaiglx"
+# for forcing aiglx deactivation type "live noaiglx"
 
 # Import archive signing key
 wget -O - http://debian.beryl-project.org/root@lupine.me.uk.gpg | apt-key add -
@@ -13,38 +14,64 @@
 apt-get update
 
 # Install packages
-PACKAGES="beryl beryl-core beryl-manager beryl-plugins beryl-settings beryl-settings-bindings beryl-settings-simple"
-#beryl-plugins-unsupported
+PACKAGES="beryl beryl-core beryl-manager beryl-plugins beryl-settings beryl-settings-bindings beryl-settings-simple mesa-utils"
 
-if [ -f /usr/bin/gnome-session ]
-then
-	PACKAGES="${PACKAGES} emerald emerald-themes heliodor"
-fi
+dpkg -s gnome-core > /dev/null 2>&1 && PACKAGES="${PACKAGES} emerald emerald-themes heliodor"
+dpkg -s kde-core   > /dev/null 2>&1 && PACKAGES="${PACKAGES} aquamarine"
 
-if [ -f /usr/bin/kstart ]
-then
-	PACKAGES="${PACKAGES} aquamarine"
-fi
-
 apt-get install --yes ${PACKAGES}
 
 # Add init script
-cat > /etc/init.d/aixgl << EOF
+cat > /etc/init.d/aiglx << EOF
 #!/bin/sh
+activate_3d()
+{
+        activate_aiglx
+        activate_beryl
+}
 
-if cat /proc/cmdline | grep aixgl > /dev/null
-then
-	echo "Configuring xorg for aixgl..."
+activate_aiglx()
+{
+        echo "" >> /etc/X11/xorg.conf
+        echo "# Added by beryl-hook.sh" >> /etc/X11/xorg.conf
+        echo "Section \"Extensions\"" >> /etc/X11/xorg.conf
+        echo " Option \"Composite\" \"Enable\"" >> /etc/X11/xorg.conf
+        echo "EndSection" >> /etc/X11/xorg.conf
 
-	echo "" >> /etc/X11/xorg.conf
-	echo "# Added by beryl-hook.sh" >> /etc/X11/xorg.conf
-	echo "Section \"Extensions\"" >> /etc/X11/xorg.conf
-	echo " Option \"Composite\" \"Enable\"" >> /etc/X11/xorg.conf
-	echo "EndSection" >> /etc/X11/xorg.conf
+        sed -i -e "s/Section \"Device\""/"Section \"Device\"\n\t Option \"XAANoOffscreenPixmaps\" \"true\"\n\t Option \"AddARGBGLXVisuals\" \"on\"\n\t Option \"AllowGLXWithComposite\" \"true\"/" -e "s/Section \"Module\""/"Section \"Module\"\n\t Load \"i2c\"\n\t Load \"int10\"\n\t Load \"xtrap\"\n\t Load \"vbe\"/" /etc/X11/xorg.conf
+}
 
-	sed -i -e "s/Section \"Device\""/"Section \"Device\"\n\t Option \"XAANoOffscreenPixmaps\" \"true\"\n\t Option \"AddARGBGLXVisuals\" \"on\"\n\t Option \"AllowGLXWithComposite\" \"true\"/" -e "s/Section \"Module\""/"Section \"Module\"\n\t Load \"i2c\"\n\t Load \"int10\"\n\t Load \"xtrap\"\n\t Load \"vbe\"/" /etc/X11/xorg.conf
+activate_beryl()
+{
+        # http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html
+        ! [ -d /etc/xdg/autostart ] && mkdir -p /etc/xdg/autostart
+        cat > /etc/xdg/autostart/beryl-manager.desktop <<EOS
+[Desktop Entry]
+Encoding=UTF-8
+Name=Beryl Manager
+GenericName=3D Window Manager
+Comment=Beryl Manager daemon
+Icon=
+Exec=beryl-starter
+Terminal=false
+Type=Application
+Categories=
+EOS
+
+        cat > /usr/local/bin/beryl-starter <<EOS
+#!/bin/sh
+glxinfo > /dev/null 2>&1 && beryl-manager
+EOS
+        chmod 0755 /usr/local/bin/beryl-starter
+}
+
+if ! cat /proc/cmdline | grep noaiglx > /dev/null
+then
+        echo "Configuring xorg for aiglx ..."    
+        activate_3d
 fi
 EOF
 
-chmod 0755 /etc/init.d/aixgl
-update-rc.d aixgl defaults
+chmod 0755 /etc/init.d/aiglx
+update-rc.d aiglx defaults
+




More information about the Debian-live-changes mailing list