diff --git a/speech/clipboard_translator.sh b/speech/clipboard_translator.sh index f05139d..d9ef4cc 100755 --- a/speech/clipboard_translator.sh +++ b/speech/clipboard_translator.sh @@ -13,7 +13,7 @@ if [[ $# -ne 2 ]]; then fi # Wait for the application to start -while ! pgrep -u "$USER" ^$1 &> /dev/null ; do +while ! pgrep -f -u "$USER" "$1" &> /dev/null ; do sleep 0.05 done @@ -56,7 +56,7 @@ insert_database() { } # Read so long as the application is running -while pgrep -u "$USER" ^$1 &> /dev/null ; do +while pgrep -f -u "$USER" "$1" &> /dev/null ; do sleep 0.05 text="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)" if [[ -f ~/.agmsilent ]]; then