пятница, 14 октября 2011 г.

Выключение тачпада клавишами Fn+F9 на ноутбуках Asus серии K в Ubuntu

На этих ноутубках жутко не удобно расположен тачпад и при наборе текста его можно зацепить и фокус окна собьётся.

Открываем конфиг

$ sudo gedit /etc/acpi/events/asus-touchpad

Перезаписываем содержимое

# /etc/acpi/events/asus-touchpad
# This is called when the user presses the touchpad button and calls
# /etc/acpi/asus-touchpad.sh for further processing.

event=hotkey ATKD 0000006b
action=/etc/acpi/asus-touchpad.sh

Сохраняем и выходим

$ sudo gedit /etc/acpi/asus-touchpad.sh

Вставляем код

#!/bin/sh
[ -f /usr/share/acpi-support/state-funcs ] || exit 0

. /usr/share/acpi-support/power-funcs

# if this is the right behavior, then this should be moved out of acpi-support
# to hal (or whatever is replacing hal for such events)
getXconsole

XINPUTNUM=`xinput list 'ImPS/2 Logitech Wheel Mouse' | sed -n -e's/.*id=\([0-9]\+\).*/\1/p'`

# get the current state of the touchpad
TPSTATUS=`xinput list-props $XINPUTNUM | awk '/Device Enabled/ { print $NF }'`

# if getting the status failed, exit
test -z $TPSTATUS && exit 1

if [ $TPSTATUS = 0 ]; then
xinput set-int-prop $XINPUTNUM "Device Enabled" 8 1
else
xinput set-int-prop $XINPUTNUM "Device Enabled" 8 0
fi

Сохраняем и выходим.

Перезапускаем ACPI-систему

$ sudo /etc/init.d/acpid restart

После этих манипуляций отключение тачпада должно заработать.