diff --git a/bin/input-event b/bin/input-event new file mode 100755 index 0000000..05f3da6 --- /dev/null +++ b/bin/input-event @@ -0,0 +1,41 @@ +#!/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,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 + ;; + XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad") + xinput set-prop $device 'Synaptics Off' 1 + ;; +esac diff --git a/xkb/default.xkb b/xkb/default.xkb new file mode 100644 index 0000000..826d50c --- /dev/null +++ b/xkb/default.xkb @@ -0,0 +1,14 @@ +# -*- conf -*- + +# Default configuration with: +# - compose → rwin +# - capslock as ctrl +# - us+fr and switch with rctrl+rshift +# - pause key becomes xscreensaver +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us+fr:2+inet(evdev)+compose(rwin)+ctrl(nocaps)+group(rctrl_rshift_toggle)+vbe(pause)" }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/xkb/norwin.xkb b/xkb/norwin.xkb new file mode 100644 index 0000000..291cb11 --- /dev/null +++ b/xkb/norwin.xkb @@ -0,0 +1,13 @@ +# -*- conf -*- + +# Configuration with: +# - compose → ralt +# - capslock as ctrl +# - us+fr and switch with rctrl+rshift +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us+fr:2+inet(evdev)+compose(ralt)+ctrl(nocaps)+group(rctrl_rshift_toggle)" }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/xkb/symbols/vbe b/xkb/symbols/vbe new file mode 100644 index 0000000..5708657 --- /dev/null +++ b/xkb/symbols/vbe @@ -0,0 +1,13 @@ +partial +xkb_symbols "pause" { + key { + [ XF86ScreenSaver, NoSymbol ] + }; +}; + +partial +xkb_symbols "webcam" { + key { + [ XF86ScreenSaver, NoSymbol ] + }; +}; diff --git a/xkb/thinkpad-extra.xkb b/xkb/thinkpad-extra.xkb new file mode 100644 index 0000000..387b391 --- /dev/null +++ b/xkb/thinkpad-extra.xkb @@ -0,0 +1,10 @@ +# -*- conf -*- + +# Configuration for thinkpad extra buttons +xkb_keymap { + xkb_keycodes { include "evdev+aliases(qwerty)" }; + xkb_types { include "complete" }; + xkb_compat { include "complete" }; + xkb_symbols { include "pc+us+inet(evdev)+vbe(webcam)" }; + xkb_geometry { include "pc(pc105)" }; +}; diff --git a/xsession b/xsession index 1f0e3fe..8659708 100644 --- a/xsession +++ b/xsession @@ -41,6 +41,8 @@ case "$(hostname)" in ;; esac +[ -x ~/bin/inputplug ] && ~/bin/inputplug -0 -c ~/.awesome/bin/input-event + [ -x /usr/sbin/rfkill ] && rfkill block all 2> /dev/null [ -x /usr/bin/xbacklight ] && xbacklight = 60 2> /dev/null [ -x /usr/bin/redshift ] && redshift -l 2.3508:48.8567 -t 6500:5500 2> /dev/null &