aboutsummaryrefslogtreecommitdiff
path: root/linux-control-remap.sh
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-12-16 19:39:56 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-12-16 19:39:56 -0500
commitf8d2f80eb0a7faf875f5527125a81e5c635c8150 (patch)
tree2fa7bc9c771943a8523274d7dc980f6719d845b4 /linux-control-remap.sh
parent30f16cde9920c2debf73b48d92eb722ada9cbcb3 (diff)
downloaddotfiles-f8d2f80eb0a7faf875f5527125a81e5c635c8150.tar.gz
dotfiles-f8d2f80eb0a7faf875f5527125a81e5c635c8150.tar.xz
Add a shell script to automatically install the hwdb config
Diffstat (limited to 'linux-control-remap.sh')
-rw-r--r--linux-control-remap.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux-control-remap.sh b/linux-control-remap.sh
new file mode 100644
index 0000000..51ae56b
--- /dev/null
+++ b/linux-control-remap.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+set -x
+_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'
+# This is a fucking lifesaver
+# evdev:name:AT Translated Set 2 keyboard:*
+# systemd-hwdb update && udevadm trigger
+# 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.conf
+$_s systemd-hwdb update
+$_s udevadm trigger