New functions/bin structure

This commit is contained in:
2021-08-02 05:18:07 -06:00
parent 2500a49c1e
commit e726ba61ae
54 changed files with 313 additions and 665 deletions

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env sh
function load_xkb_map {
XKBDIR="$HOME/.xkb"
XKBMAPFILE="$XKBDIR/keymap/$(hostname --fqdn)"
[[ -r "$XKBMAPFILE" ]] || XKBMAPFILE="${XKBMAPFILE%/*}/default"
echo "loading keymap from $XKBMAPFILE"
xkbcomp -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}"
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
}
load_xkb_map