aboutsummaryrefslogtreecommitdiff
path: root/remap
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2024-01-20 15:26:26 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2024-01-20 15:26:26 -0500
commit80f30a70e631f356c76fe8fba7a79c1ebb7e8399 (patch)
tree3b7bda6173375e6ba5813da734cf50dd4dba0123 /remap
parent7f12f2f81574bb8e76aed5a6a65ad23bde32eae4 (diff)
downloaddotfiles-80f30a70e631f356c76fe8fba7a79c1ebb7e8399.tar.gz
dotfiles-80f30a70e631f356c76fe8fba7a79c1ebb7e8399.tar.xz
Further adjust key remappings
Diffstat (limited to 'remap')
-rw-r--r--remap/at-kbd.sh23
-rw-r--r--remap/mbair.sh22
2 files changed, 45 insertions, 0 deletions
diff --git a/remap/at-kbd.sh b/remap/at-kbd.sh
new file mode 100644
index 0000000..37ae9a6
--- /dev/null
+++ b/remap/at-kbd.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -ex
+_s="sudo"
+[ "$(id -u)" -eq 0 ] && _s=""
+hwdb_f="$(mktemp)"
+cat > "$hwdb_f" <<EOF
+# /etc/udev.d/hwdb/01-keyboard.hwdb
+# https://wiki.archlinux.org/title/map_scancodes_to_keycodes
+# also 'yum -y install evtest'
+# evdev:name:AT Translated Set 2 keyboard:*
+# systemd-hwdb update && udevadm trigger
+# or perhaps:
+# udevadm hwdb -u
+# This should match all AT keyboards, apparently
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
+ KEYBOARD_KEY_3a=leftctrl
+ KEYBOARD_KEY_1d=leftctrl
+ KEYBOARD_KEY_9d=capslock
+EOF
+
+$_s cp "$hwdb_f" /etc/udev/hwdb.d/01-keyboard.hwdb
+$_s systemd-hwdb update
+$_s udevadm trigger
diff --git a/remap/mbair.sh b/remap/mbair.sh
new file mode 100644
index 0000000..8ec0e46
--- /dev/null
+++ b/remap/mbair.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+set -ex
+_s="sudo"
+[ "$(id -u)" -eq 0 ] && _s=""
+hwdb_f="$(mktemp)"
+cat > "$hwdb_f" <<EOF
+# Example can be hand via evemu-describe and grabbing the DMI line.
+# This should match most apple keyboards, though.
+#
+# From for remapping you'll want to run `evtest` for the input,
+# the keyboard key code, take the value you get from the type 4 EV_MSC
+# lines
+evdev:name:Apple Inc*Internal Keyboard*
+ KEYBOARD_KEY_70039=leftctrl
+ KEYBOARD_KEY_700e3=leftalt
+ KEYBOARD_KEY_700e2=leftmeta
+ KEYBOARD_KEY_700e6=capslock
+EOF
+
+$_s cp "$hwdb_f" /etc/udev/hwdb.d/01-mbair.hwdb
+$_s systemd-hwdb update
+$_s udevadm trigger