mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-09 17:54:22 +02:00
Acting on DRM change is a bad idea as monitors come and go during detection and autorandr running in parallel is not reliable enough.
45 lines
1.1 KiB
Bash
Executable file
45 lines
1.1 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/awesome/xkb \
|
|
$HOME/.config/awesome/xkb/$1.xkb ${DISPLAY}
|
|
}
|
|
|
|
printf "input-event: $use: [%3d] $event $name\n" $device
|
|
|
|
case "$event,$use,$(uname -n),$name" in
|
|
XIDeviceDisabled,*)
|
|
:
|
|
;;
|
|
*,XISlaveKeyboard,*,"Topre Corporation Realforce 87")
|
|
sleep 2
|
|
autorandr --change
|
|
xkb default
|
|
;;
|
|
*,XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
|
|
xkb x1
|
|
;;
|
|
*,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
|