Turn off speech with clipboard utilities and window title reader by creating the file ~/.agmsilent
This commit is contained in:
parent
1ab8e8620a
commit
b5ff9b8756
@ -8,6 +8,10 @@ done
|
||||
unset cliptext
|
||||
socketFile="$(find /tmp -maxdepth 1 -name "orca-*.sock")"
|
||||
while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
sleep 0.05
|
||||
if [[ -f ~/.agmsilent ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
tmp="$(pbpaste 2> /dev/null)"
|
||||
else
|
||||
@ -38,7 +42,6 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
sleep 0.05
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -25,6 +25,9 @@ translationFile="${XDG_CACHE_HOME:-$HOME/.cache}/audiogame-manager/${fileName}"
|
||||
while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
sleep 0.05
|
||||
text="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)"
|
||||
if [[ -f ~/.agmsilent ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ "${text}" =~ ^[0-9A-Za-z[:space:][:punct:]]+$ ]]; then
|
||||
spd-say -- "$text"
|
||||
echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null
|
||||
@ -75,3 +78,5 @@ EOF
|
||||
spd-say -- "$translated"
|
||||
echo "" | xclip -d "${DISPLAY:-:0}" -selection clipboard 2> /dev/null
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -9,6 +9,10 @@ done
|
||||
|
||||
# Read so long as the application is running
|
||||
while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
sleep 0.05
|
||||
if [[ -f ~/.agmsilent ]]; then
|
||||
continue
|
||||
fi
|
||||
wnd_focus=$(xdotool getwindowfocus)
|
||||
wnd_title=$(xprop -id $wnd_focus WM_NAME)
|
||||
lookfor='"(.*)"'
|
||||
@ -20,5 +24,6 @@ while pgrep -u "$USER" ^$1 &> /dev/null ; do
|
||||
old_title="$wnd_title"
|
||||
fi
|
||||
fi
|
||||
sleep 0.01
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user