#!/bin/sh # Event handler for inputplug event="$1" device="$2" use="$3" name="$4" [ x"$event" = x"XIDeviceEnabled" ] || exit 0 # 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 case "$use,$(uname -n),$name" in 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 xrandr --output DP4 --auto --right-of DP3 --dpi 96 sleep 2 echo 'awesome.restart()' | awesome-client fi rfkill block wifi xkb default ;; XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard") xkb x1 ;; XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard") xkb norwin ;; XISlaveKeyboard,*,"ThinkPad Extra Buttons") xkb thinkpad-extra ;; XISlaveKeyboard,*) xkb default ;; XISlavePointer,*,"Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)") xinput set-ptr-feedback $device 3 3 1 ;; 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 xinput set-ptr-feedback $device 2 5 1 ;; 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' 1 ;; XISlavePointer,zoro,"ELAN Touchscreen") xinput disable $device ;; XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad") xinput set-prop $device 'Synaptics Off' 1 ;; esac