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

51 lines
1.2 KiB
Text
Raw Normal View History

#!/bin/sh
# Event handler for inputplug
event="$1"
device="$2"
use="$3"
name="$4"
# Load the given keymap
xkb() {
xkbcomp -i ${device} -w 0 -I$HOME/.config/i3/dotfiles/xkb \
$HOME/.config/i3/dotfiles/xkb/$1.xkb ${DISPLAY}
}
case $event in
XIDeviceDisabled) exit 0 ;;
XISlaveRemoved) exit 0 ;;
esac
2018-07-04 18:46:38 +02:00
printf "input-event: $use: [%3d] $event $name\n" $device
2020-02-04 11:23:19 +01:00
set +x
2018-07-04 18:46:38 +02:00
case "$event,$use,$(uname -n),$name" in
*,XISlaveKeyboard,*,"Topre Corporation Realforce 87")
xkb default
for i in $(seq 1 3); do
sleep 1
autorandr --load blade && break
done
;;
2018-07-04 18:46:38 +02:00
*,XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
xkb x1gen2
;;
2018-07-04 18:46:38 +02:00
*,XISlaveKeyboard,*,"ThinkPad Extra Buttons")
xkb thinkpad-extra
;;
2018-07-04 18:46:38 +02:00
*,XISlaveKeyboard,*)
xkb default
;;
*,XISlavePointer,*,"Logitech USB Receiver Mouse")
xinput set-ptr-feedback $device 30 5 2
;;
*,XISlavePointer,chocobo,"SynPS/2 Synaptics TouchPad")
xinput set-props $device "libinput Natural Scrolling Enabled" 1
;;
*,XISlavePointer,*,"ELAN Touchscreen")
2014-06-11 17:53:13 +02:00
xinput disable $device
;;
esac