Game "Axel Pong" added.

This commit is contained in:
Storm Dragon
2026-01-03 02:17:50 -05:00
parent 27223b47ce
commit c1f2e47e28
3 changed files with 41 additions and 13 deletions

4
.install/Axel Pong.sh Normal file
View File

@@ -0,0 +1,4 @@
download "https://axelek.pl/index/axel_pong.7z"
install_wine_bottle
install_with_progress 7z "Extracting game files..." x -o"$WINEPREFIX/drive_c/Program Files/Axel Pong" "${cache}/axel_pong.7z"
add_launcher "c:\Program Files\Axel Pong\axel_pong.exe"

View File

@@ -343,6 +343,9 @@ custom_launch_parameters() {
if [[ "${game[2]}" == "Road to Rage" ]]; then
"${scriptDir}/speech/speak_window_title.sh" trtr.exe &
fi
if [[ "${game[2]}" == "Axel Pong" ]]; then
"${scriptDir}/speech/speak_window_title.sh" axel_pong.exe &
fi
if [[ "${game[2]}" == "Sequence Storm" ]]; then
"${scriptDir}/speech/clipboard_reader.sh" SequenceStorm &
fi

View File

@@ -1,28 +1,49 @@
#!/usr/bin/env bash
# Adapted from the bash snippet found at:
# https://bbs.archlinux.org/viewtopic.php?id=117031
# Get window title, handling Wine virtual desktop child windows
get_window_title() {
local exeName="$1"
local wndFocus wndTitle
wndFocus=$(xdotool getwindowfocus)
wndTitle=$(xprop -id "$wndFocus" WM_NAME 2>/dev/null)
# Check if we're focused on Wine Desktop
if [[ "$wndTitle" == *"Wine Desktop"* ]]; then
# Look for child window belonging to our executable
wndTitle=$(xwininfo -tree -root 2>/dev/null | grep -i "\"$exeName\"" | head -1)
# Extract the window title from xwininfo output (format: 0xID "Title": ("class" "class"))
if [[ "$wndTitle" =~ \"([^\"]+)\":\ \(\"$exeName\" ]]; then
echo "${BASH_REMATCH[1]}"
return
fi
fi
# Standard case - extract title from xprop output
if [[ "$wndTitle" =~ \"(.*)\" ]]; then
echo "${BASH_REMATCH[1]}"
fi
}
# Wait for the application to start
while ! pgrep -u "$USER" ^$1 &> /dev/null ; do
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
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
wndTitle=$(get_window_title "$1")
if [[ -n "$wndTitle" ]] && [[ "$oldTitle" != "$wndTitle" ]]; then
spd-say -- "$wndTitle"
oldTitle="$wndTitle"
fi
done