summaryrefslogtreecommitdiff
path: root/config/gen_positions.sh
blob: b83ca9d9b39b3b6a007a290231c9cabfa1bd5d91 (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"
grep "#define " $f | awk '$2 ~ /^L[^H]/ { printf(" %s", $2) }'
echo
echo -n "#define RIGHT"
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