Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

swipeToQuery(){
	swipe=$1
	printf '^'
	printf ${swipe:0:2}
	if test "${swipe:2}"; then
		printf "${swipe:2}" |grep -o . | xargs printf '\?%s'
	fi
	printf '$'
}

wordlist="$2"

query=$(swipeToQuery $1)
echo "query: $query" > /dev/stderr
grep $query "$2"