]>
git.rmz.io Git - dotfiles.git/blob - bin/xkbload
   3 # This script is meant to be called by inputplug when a new input device event happened. 
   5 xkb_config
=$XDG_CONFIG_HOME/xkb
 
   6 xkb_file
=$xkb_config/default.xkb
 
   7 [[ -f $xkb_config/$
(hostname
).xkb 
]] && xkb_file
=$
(hostname
) 
  11     kinadv2
="Kinesis Advantage2 Keyboard" 
  12     if [[ "$device_name" == "$kinadv2" ]]; then 
  13         # HACK: if I don't sleep, capslock is enabled on reconnect 
  15         echo "xkbcomp default.xkb" 
  16         xkbcomp 
-w0 -I$xkb_config $xkb_file $DISPLAY -i $device_id 
  22     case $
(type -t $event_type) in 
  23         function) $event_type ;; 
  24         *) echo "No handler for event '$event_type'" ;; 
  28 if [[ $# -eq 4 ]]; then 
  36     # if not called with four args, loop over all devices 
  37     event_type
=XIDeviceEnabled
 
  38     for device_id 
in $
(xinput list 
--id-only); do 
  39         device_name
="$(xinput list --name-only $device_id)" 
  40         device_type
="UnknownTODO"  # don't know how to get this easily