vincentbernat.i3wm-configur.../bin/input-event

84 lines
2.8 KiB
Text
Raw Normal View History

#!/bin/sh
# Event handler for inputplug
event="$1"
device="$2"
use="$3"
name="$4"
2014-09-17 18:33:07 +02:00
case "$event" in
XIDevice*)
;;
*)
exit 0
;;
esac
event=${event#XIDevice}
# 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-17 18:33:07 +02:00
case "$event,$use,$(uname -n),$name" in
# We try to use this keyboard to detect the dock
Disabled,XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
# We are being undocked?
sleep 2
if xrandr | grep '^DP. connected'; then
# No, still docked?
:
else
xrandr --output DP3 off --output DP4 off --output eDP1 --auto --dpi 144
2014-09-17 18:33:07 +02:00
fi
;;
Enabled,XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
# Are we getting docked?
sleep 2
if xrandr | grep '^DP. connected'; then
xrandr --output eDP1 --off --output DP3 --auto --primary --output DP4 --auto --right-of DP3 --dpi 96
fi
;;
Enabled,XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
xkb x1
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard")
xkb norwin
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlaveKeyboard,*,"ThinkPad Extra Buttons")
xkb thinkpad-extra
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlaveKeyboard,*)
xkb default
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlavePointer,*,"Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)")
xinput set-ptr-feedback $device 3 3 1
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlavePointer,*,"TPPS/2 IBM TrackPoint")
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-09-17 18:33:07 +02:00
Enabled,XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad")
# [ 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
xinput set-prop $device 'Synaptics Off' 3 # Needs a patch: http://lists.x.org/archives/xorg/2014-June/056689.html
xinput set-prop $device 'Synaptics Two-Finger Scrolling' 1 1
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlavePointer,zoro,"ELAN Touchscreen")
2014-06-11 17:53:13 +02:00
xinput disable $device
;;
2014-09-17 18:33:07 +02:00
Enabled,XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad")
xinput set-prop $device 'Synaptics Off' 1
;;
esac