From 6060db32b949d62757b668f972648465f1e302c7 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 31 Jan 2024 15:42:17 +0100 Subject: Initial --- make_keysym_table.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 make_keysym_table.sh (limited to 'make_keysym_table.sh') diff --git a/make_keysym_table.sh b/make_keysym_table.sh new file mode 100755 index 0000000..5b0c325 --- /dev/null +++ b/make_keysym_table.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +output=$(sed -n 's/^#define XKB_KEY_\([a-zA-Z_0-9]\+\)\s\+\(0x[0-9a-f]\+\).*/\t{"\1", {\2}},/p' /usr/include/xkbcommon/xkbcommon-keysyms.h) + +len=$(wc -l <<<"$output") + +if [[ $1 = --source ]]; then + cat <, $len> keysym_table{{ +$output +}}; +EOF +elif [[ $1 = --header ]]; then + cat < +#include +#include "xutil.h" + + +extern const std::array, $len> keysym_table; +EOF +else + echo >&2 "$0: invalid flags" + exit 1 +fi -- cgit v1.2.3-70-g09d2