Files
audiogame-manager/speech/speak_window_title.sh
Hunter Jozwiak e3289b92cb Fix some critters.
After about half an hour of cussin and spitting tobacco juice, I came
to some discoveries:
* The clipboard translator wasn't even launching successfully.
* For BKs 1 and 2, remove the nvda dll thereby forcing it to use the
clipboard reader.
* Fix up BK2 to go into the right bottle; it is a 32-bit game.
2025-10-07 10:14:54 -04:00

30 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Adapted from the bash snippet found at:
# https://bbs.archlinux.org/viewtopic.php?id=117031
# Wait for the application to start
while ! pgrep -u "$USER" ^$1 &> /dev/null ; do
sleep 0.05
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='"(.*)"'
if [[ "$wnd_title" =~ $lookfor ]]; then
wnd_title=${BASH_REMATCH[1]}
if [[ "$oldTitle" != "$wnd_title" ]]; then
spd-say -- "$wnd_title"
oldTitle="$wnd_title"
fi
fi
done
exit 0