Clipboard-translator will now start on launch of Bokurano Daibouken 1 and 2.
This commit is contained in:
parent
3332cb8d39
commit
f25d5d4b90
@ -775,6 +775,9 @@ game_launcher() {
|
|||||||
if [[ "$game" =~ laser-breakout ]]; then
|
if [[ "$game" =~ laser-breakout ]]; then
|
||||||
pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd &
|
pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd &
|
||||||
fi
|
fi
|
||||||
|
if [[ "$game" =~ ^bokurano-daibouken\||bokurano-daibouken-2\| ]]; then
|
||||||
|
"${0%/*}/speech/clipboard_translator.sh" play.exe &
|
||||||
|
fi
|
||||||
if [[ "$game" =~ bokurano-daibouken-3 ]]; then
|
if [[ "$game" =~ bokurano-daibouken-3 ]]; then
|
||||||
pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd &
|
pgrep -u "$USER" nvda2speechd &> /dev/null || ${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd &
|
||||||
dictPath="$(winepath "${winePath}")"
|
dictPath="$(winepath "${winePath}")"
|
||||||
|
@ -12,7 +12,18 @@ export dictionaryFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-m
|
|||||||
if [[ ! -r "$dictionaryFile" ]]; then
|
if [[ ! -r "$dictionaryFile" ]]; then
|
||||||
touch "$dictionaryFile"
|
touch "$dictionaryFile"
|
||||||
fi
|
fi
|
||||||
while : ; do
|
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "Usage: $0 application name."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
newText=""
|
newText=""
|
||||||
translatedText=""
|
translatedText=""
|
||||||
newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)"
|
newText="$(xclip -d "${DISPLAY:-:0}" -selection clipboard -o 2> /dev/null)"
|
||||||
|
Loading…
Reference in New Issue
Block a user