vincentbernat.i3wm-configur.../bin/input-event
Vincent Bernat d85a504c53 Initial i3 configuration
This is derived from my Awesome configuration. Still a lot to do from
a WM perspective. The organization is a bit different and I am giving
it up on the per-display systemd units as it does not really work due
to the fact we only have one user DBus and one environment.
2021-07-04 08:38:39 +02:00

50 lines
1.2 KiB
Bash
Executable file

#!/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
printf "input-event: $use: [%3d] $event $name\n" $device
set +x
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
;;
*,XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
xkb x1gen2
;;
*,XISlaveKeyboard,*,"ThinkPad Extra Buttons")
xkb thinkpad-extra
;;
*,XISlaveKeyboard,*)
xkb default
;;
*,XISlavePointer,*,"Logitech USB Receiver Mouse")
xinput set-ptr-feedback $device 30 5 2
;;
*,XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad")
xinput set-props $device "libinput Natural Scrolling Enabled" 1
;;
*,XISlavePointer,zoro,"ELAN Touchscreen")
xinput disable $device
;;
esac