Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
Diffstat (limited to 'swipeGuess.sh')
-rwxr-xr-xswipeGuess.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/swipeGuess.sh b/swipeGuess.sh
new file mode 100755
index 0000000..53fc4b4
--- /dev/null
+++ b/swipeGuess.sh
@@ -0,0 +1,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"