plugins for wvkbd using swipeGuess
swipeGuessPicker: refactor variables
Zach DeCook 2022-01-26
parent 3359556 · commit 52128ac
-rwxr-xr-xswipeGuessPicker.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/swipeGuessPicker.sh b/swipeGuessPicker.sh
index 9e5fbd4..c344052 100755
--- a/swipeGuessPicker.sh
+++ b/swipeGuessPicker.sh
@@ -1,15 +1,17 @@
#!/bin/sh
-rm "$XDG_RUNTIME_DIR/sgp.sock"
-mkfifo "$XDG_RUNTIME_DIR/sgp.sock"
-cat 0<> "$XDG_RUNTIME_DIR/sgp.sock"|suggpicker 2>/dev/null|completelyTypeWord.sh &
-swipeGuess ~/.local/share/sxmo/words.txt 5 | while read -r word; do
+sock="$XDG_RUNTIME_DIR/sgp.sock"
+words=~/.local/share/sxmo/words.txt
+rm "$sock"
+mkfifo "$sock"
+cat 0<> "$sock"|suggpicker 2>/dev/null|completelyTypeWord.sh &
+swipeGuess "$words" 5 | while read -r word; do
set -- $word
if test "$1" && ! test "$2"; then
wtype "${1:1}"
elif ! test "$2"; then
- echo "" >> "$XDG_RUNTIME_DIR/sgp.sock"
+ echo "" >> "$sock"
else
- echo "$word" >> "$XDG_RUNTIME_DIR/sgp.sock"
+ echo "$word" >> "$sock"
fi
done