~earboxer/SwipeBehaviors

52128ace9cb7dfa67811e7e6e8892efb922dc0a4 — Zach DeCook 8 months ago 3359556
swipeGuessPicker: refactor variables
1 files changed, 8 insertions(+), 6 deletions(-)

M swipeGuessPicker.sh
M swipeGuessPicker.sh => swipeGuessPicker.sh +8 -6
@@ 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