summaryrefslogtreecommitdiff
path: root/examples/beryl-hook.sh
blob: a58056d9d2900e16c4c3a0595bae2f4b1f48ae68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

# This is a hook for live-helper(7) to install beryl and enable aixgl.
# It was originally written by Inigo Tejedor Arrondo <inigo@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.

# Import archive signing key
wget -O - http://debian.beryl-project.org/root@lupine.me.uk.gpg | apt-key add -

# Update indices
apt-get update

# Install packages
PACKAGES="beryl beryl-core beryl-manager beryl-plugins beryl-settings beryl-settings-bindings beryl-settings-simple"
#beryl-plugins-unsupported

if [ -f /usr/bin/gnome-session ]
then
	PACKAGES="${PACKAGES} emerald emerald-themes heliodor"
fi

if [ -f /usr/bin/kstart ]
then
	PACKAGES="${PACKAGES} aquamarine"
fi

apt-get install --yes ${PACKAGES}

# Add init script
cat > /etc/init.d/aixgl << EOF
#!/bin/sh

if cat /proc/cmdline | grep aixgl > /dev/null
then
	echo "Configuring xorg for aixgl..."

	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
fi
EOF

chmod 0755 /etc/init.d/aixgl
update-rc.d aixgl defaults