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

46 lines
1.1 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,chocobo,"AT Translated Set 2 keyboard")
xkb x1gen2
;;
*,XISlaveKeyboard,*,"Yubico YubiKey OTP+FIDO+CCID")
ssh-add -e /usr/lib/x86_64-linux-gnu/libykcs11.so 2> /dev/null
ssh-add -s /usr/lib/x86_64-linux-gnu/libykcs11.so
;;
2018-07-04 18:46:38 +02:00
*,XISlaveKeyboard,*)
# Todo: detect the fact it is a "classic" keyboard
xkb default
;;
*,XISlavePointer,*,"Logitech USB Receiver Mouse")
xinput set-ptr-feedback $device 30 5 2
;;
*,XISlavePointer,*,"TPPS/2 IBM TrackPoint")
xinput set-prop $device "libinput Accel Speed" 1
;;
*,XISlavePointer,*,"ELAN Touchscreen")
2014-06-11 17:53:13 +02:00
xinput disable $device
;;
esac