2014-06-10 01:44:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Event handler for inputplug
|
|
|
|
|
|
|
|
event="$1"
|
|
|
|
device="$2"
|
|
|
|
use="$3"
|
|
|
|
name="$4"
|
|
|
|
|
2014-09-18 14:58:51 +02:00
|
|
|
[ x"$event" = x"XIDeviceEnabled" ] || exit 0
|
2014-06-10 01:44:42 +02:00
|
|
|
|
|
|
|
# Load the given keymap
|
|
|
|
xkb() {
|
|
|
|
xkbcomp -i ${device} -w 0 -I$HOME/.config/awesome/xkb \
|
|
|
|
$HOME/.config/awesome/xkb/$1.xkb ${DISPLAY}
|
|
|
|
}
|
|
|
|
|
|
|
|
printf "$use: [%3d] $name\n" $device
|
|
|
|
|
2014-09-18 14:58:51 +02:00
|
|
|
case "$use,$(uname -n),$name" in
|
|
|
|
XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
|
2014-09-17 18:33:07 +02:00
|
|
|
# Are we getting docked?
|
|
|
|
sleep 2
|
2014-09-29 11:01:45 +02:00
|
|
|
dock
|
2014-09-18 07:30:43 +02:00
|
|
|
xkb default
|
2014-09-17 18:33:07 +02:00
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
|
2014-06-10 20:59:47 +02:00
|
|
|
xkb x1
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard")
|
2014-06-10 01:44:42 +02:00
|
|
|
xkb norwin
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlaveKeyboard,*,"ThinkPad Extra Buttons")
|
2014-06-10 01:44:42 +02:00
|
|
|
xkb thinkpad-extra
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlaveKeyboard,*)
|
2014-06-10 01:44:42 +02:00
|
|
|
xkb default
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlavePointer,*,"Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)")
|
2014-06-10 01:44:42 +02:00
|
|
|
xinput set-ptr-feedback $device 3 3 1
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlavePointer,*,"TPPS/2 IBM TrackPoint")
|
2014-06-10 01:44:42 +02:00
|
|
|
xinput set-prop $device 'Evdev Wheel Emulation' 1
|
|
|
|
xinput set-prop $device 'Evdev Wheel Emulation Button' 2
|
|
|
|
xinput set-prop $device 'Evdev Wheel Emulation Axes' 6 7 4 5
|
2014-07-03 11:11:29 +02:00
|
|
|
xinput set-ptr-feedback $device 2 5 1
|
2014-06-10 01:44:42 +02:00
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad")
|
2014-06-11 17:41:21 +02:00
|
|
|
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5112 (res 42)
|
|
|
|
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1408 - 3834 (res 42)
|
|
|
|
# The following is 60% 0 0 0 40% 60% 0 0
|
|
|
|
# The logic is explained here:
|
|
|
|
# http://who-t.blogspot.de/2013/12/lenovo-t440-touchpad-button.html
|
|
|
|
xinput set-prop $device 'Synaptics Soft Button Areas' 3656 0 0 0 2928 3656 0 0
|
2014-09-21 09:55:09 +02:00
|
|
|
xinput set-prop $device 'Synaptics Off' 1
|
2014-06-10 20:59:47 +02:00
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlavePointer,zoro,"ELAN Touchscreen")
|
2014-06-11 17:53:13 +02:00
|
|
|
xinput disable $device
|
|
|
|
;;
|
2014-09-18 14:58:51 +02:00
|
|
|
XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad")
|
2014-06-10 01:44:42 +02:00
|
|
|
xinput set-prop $device 'Synaptics Off' 1
|
|
|
|
;;
|
|
|
|
esac
|