From 994a2a2e43308d41830a6ebe632c37a8896e009e Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 29 Nov 2020 17:36:27 -0800 Subject: [PATCH] [Linux] XKB Map loading tweaks --- dotfiles/lib/bin/load_xkb_map.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dotfiles/lib/bin/load_xkb_map.sh b/dotfiles/lib/bin/load_xkb_map.sh index 3e4c1d17..841b83e8 100755 --- a/dotfiles/lib/bin/load_xkb_map.sh +++ b/dotfiles/lib/bin/load_xkb_map.sh @@ -8,4 +8,13 @@ echo "loading keymap from $XKBMAPFILE" xkbcomp -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}" -unset XKBDIR XKBMAPFILE +XKB_DEVICE_DIR="$XKBDIR/devices" + +for file in "$XKB_DEVICE_DIR"/* +do + DEVICE_ID=$(xinput | grep "$(basename $file)" | head -n 1 | grep -Eo "id=[0-9]*" | grep -Eo "[0-9]*") + echo $file + echo device + echo "$DEVICE_ID" + # [ ! -z "$DEVICE_ID" ] && xkbcomp -I"$XKBDIR" -i "$DEVICE_ID" "$file" "${DISPLAY%%.*}" +done