aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/xkbname.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/xkbname.sh')
-rw-r--r--scripts/xkbname.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/xkbname.sh b/scripts/xkbname.sh
new file mode 100644
index 0000000..903c829
--- /dev/null
+++ b/scripts/xkbname.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+cat /usr/include/xkbcommon/xkbcommon-keysyms.h \
+ | awk '{ print $2 }' \
+ | grep -e '^XKB_KEY_' \
+ | while read key; do
+printf '{ .code = %-24s, .name = "%s" },\n' "${key}" "${key#XKB_KEY_}"
+done > xkbname.h