#!/bin/sh # $Id: ibm-acpi.txt,v 1.5 2006-12-04 05:39:11 nickb Exp $ # tested with Thinkpad T60p, MEPIS 6.0 (kubuntu 6) # kernel 2.6.15-27-686 #2 SMP PREEMPT Tue Sep 26 09:07:28 EDT 2006 i686 GNU/Linux # requires ibm-acpi_0.0.3-1_i386.deb and ibm-acpi-infos_0.0.3-1_i386.deb # from http://www.zolnott.de/software/applications/ibm-acpi-applet-for-gnome-210-and-higher.html # requires kpowersave, powersaved from debian/ubuntu repos # SETUP: install this script as /etc/init.d/ibm-acpi, then symlink to it from /etc/rc5.d/S99ibm-acpi # to make volumne and brightness control work: for f in `find /etc/ -type f -name "modprobe.conf"`; do if [ $(grep -c 'options ibm_acpi experimental=1' $f) -eq 0 ]; then echo "Adding experimental support to ibm_acpi in $f"; echo "options ibm_acpi experimental=1" >> $f fi done # make Fn-F4 work for suspend to ram and Fn-F5 for Bluetooth toggle echo enable,0xffff >/proc/acpi/ibm/hotkey # make next/prev keys work in Konqueror, but not Firefox f=$HOME/.Xmodmap; if [ ! -f $f ]; then touch $f; fi if [ $(grep -c 'keycode 234 = XF86Back' $f) -eq 0 ]; then echo "keycode 234 = XF86Back" >> $f; fi if [ $(grep -c 'keycode 233 = XF86Forward' $f) -eq 0 ]; then echo "keycode 233 = XF86Forward" >> $f; fi b=/etc/bashrc; if [ $(grep ".Xmodmap" $b | grep -c "xmodmap") -eq 0 ]; then echo "" >> $b; echo "# Added by /etc/init.d/ibm-acpi" >> $b; echo "if [ -f \$HOME/.Xmodmap ]; then xmodmap \$HOME/.Xmodmap; fi" >> $b ; fi # OPTIONAL: to sleep (suspend to RAM) on lid close: # 1. read http://thinkwiki.org/wiki/How_to_configure_acpid#Example:_go_to_sleep_on_lid_close # 2. vi /etc/acpi/events/lidclose (or lid as in the example) # 3. vi /etc/acpi/lidclose.sh (or actions/sleep.sh as in the example) # 4. chmod +x /etc/acpi/lidclose.sh (or actions/sleep.sh as in the example)