#APPEND_TO# chroot_local-hooks/03-acritox cat <<"EOF" >/etc/init.d/kanotum-live #!/bin/bash [ "$1" != "start" ] && exit if [ ! -e /live/image ]; then update-rc.d -f kanotum-live remove rm -f /etc/init.d/kanotum-live fi X_CONF=xorg.conf function addLineToSection() { [ $# -lt 2 ] && return 1 Section="$1" Line="$2" Regexp="$3" sedScript="$(cat < "$TMPFILE" if diff -q "/etc/X11/$X_CONF" "$TMPFILE" &>/dev/null; then rm "$TMPFILE" return 1 else mv "$TMPFILE" "/etc/X11/$X_CONF" return 0 fi } function getSection() { [ $# -lt 1 ] && return 1 Section="$1" Regexp="$2" sedScript="$(cat < "$TMPFILE" if diff -q "/etc/X11/$X_CONF" "$TMPFILE" &>/dev/null; then rm "$TMPFILE" return 1 else mv "$TMPFILE" "/etc/X11/$X_CONF" return 0 fi } function setOptionInSection() { [ $# -lt 3 ] && return 1 Section="$1" Option="$2" Value="$3" if getOptionValueOfSection "$Section" "$Option" "$4" &>/dev/null; then changeOptionInSection "$Section" "$Option" "$Value" "$4" && return 0 else addLineToSection "$Section" "\tOption\t\"$Option\"\t\"$Value\"" "$4" && return 0 fi return 1 } function insertOptionInSection() { [ $# -lt 3 ] && return 1 Section="$1" Option="$2" Value="$3" if ! getOptionValueOfSection "$Section" "$Option" "$4" &>/dev/null; then addLineToSection "$Section" "\tOption\t\"$Option\"\t\"$Value\"" "$4" && return 0 fi return 1 } while read option n line do setOptionInSection "InputDevice" "${option##*.}" "$(echo "$line" | grep -oe "'.*'" | tr -d "'")" 'Driver\s*"mouse"' done < <(lshal | grep input.x11_options) if lshal | grep system.hardware.version | grep -qi thinkpad; then setOptionInSection "InputDevice" "XkbModel" "thinkpad" 'Driver\s*"kbd"' fi EOF chmod +x /etc/init.d/kanotum-live update-rc.d kanotum-live start 30 2 3 4 5 .