From ba0075e74b9d30269af6b25e61d09ba9bbdbbe3d Mon Sep 17 00:00:00 2001 From: Hunter Jozwiak Date: Thu, 11 Sep 2025 16:36:57 -0400 Subject: [PATCH] Fix clipboard translator process detection for long process names The pgrep command was failing to match Wine processes with long names like "c:\nyanchangame\bk\play.exe" because pgrep by default only matches against the first 15 characters of process names. Fixed by adding the -f flag to match against the full command line. --- speech/clipboard_translator.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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