summaryrefslogtreecommitdiff
path: root/config/gen_positions.sh
blob: c5ec9ba082de39164555a85abe2903305811d3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!bash

if [[ $# -ne 1 ]]; then
   echo "Usage: $0 <keypos file>" 1>&2
fi

f="$1"

echo -n "#define LEFT_KEYS"
grep "#define " $f | awk '$2 ~ /^L[^H]/ { printf(" %s", $2) }'
echo
echo -n "#define RIGHT_KEYS"
grep "#define " $f | awk '$2 ~ /^R[^H]/ { printf(" %s", $2) }'
echo
echo -n "#define THUMBS"
grep "#define " $f | awk '$2 ~ /^.H/ { printf(" %s", $2) }'
echo