File: thinkpad-stretchortouchpad.sh

package info (click to toggle)
acpi-support 0.137-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,008 kB
  • ctags: 9
  • sloc: sh: 1,330; makefile: 58; ansic: 51
file content (37 lines) | stat: -rwxr-xr-x 948 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

test -f /usr/share/acpi-support/key-constants || exit 0

# Lenovo rock.  They have changed the function of the Fn-F8
# combination on the LenovoPads from stretching the display (in
# hardware/BIOS) to toggling the touchpad on and off.
#
# Unfortunately they didn't bother to change the DMI strings
# consistently...  so some of the new machines say 'LENOVO' and some
# still say 'IBM'.  Yay for consistency(!).

# So:
# IBM && !Series60   => nothing
# IBM && Series60    => Touchpad toggle
# LENOVO && ThinkPad => Touchpad toggle

toggle_touchpad=0

system_manufactuer=`dmidecode -s system-manufacturer`
case "$system_manufactuer" in
    IBM*)
    system_version=`dmidecode -s system-version`
    case "$system_version" in
	ThinkPad\ [TXZ]60*)
	toggle_touchpad=1
	;;
    esac
    ;;
    LENOVO*)
    toggle_touchpad=1
    ;;
esac

if [ "$toggle_touchpad" -ne 0 -a -x /etc/acpi/asus-touchpad.sh ] ; then
    /etc/acpi/asus-touchpad.sh
fi