From 52128ace9cb7dfa67811e7e6e8892efb922dc0a4 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 26 Jan 2022 01:49:32 -0500 Subject: swipeGuessPicker: refactor variables --- swipeGuessPicker.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'swipeGuessPicker.sh') 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 -- cgit 1.4.1