Fix two bugs in the AntiMicroX plumbing before it ever runs
1. Glob case mismatch that would have silently no-op'd the whole feature: the real GitHub release asset is AntiMicroX-x86_64.AppImage (capitalized) — confirmed against the actual release, not assumed. Both the helper's own already-downloaded check and this file's own post-download lookup used a lowercase-only "antimicrox*.AppImage" glob (copied from Azahar's/PCSX2's pattern, which really are lowercase). Linux glob matching is case-sensitive, so _AMX_APP would have come back empty even after a successful download, hitting the "didn't produce a usable AppImage" branch and silently skipping the Sway launch hook with the AppImage sitting there unused. 2. Sway match criteria used app_id, which only matches native Wayland clients. AntiMicroX is a Qt5/X11 app running under XWayland here — same as ES-DE and Steam already are in this exact stock config, which is why their own for_window rules use [class="..."], not app_id. Switched to class (and title as a fallback, in case the exact WM_CLASS AntiMicroX registers differs), with a (?i) case- insensitive prefix — confirmed sway uses PCRE2 for criteria matching and (?i) is the documented syntax for exactly this, not assumed. Neither bug was fatal to Wolf itself (both fail quietly rather than crashing anything), but both would have cost real troubleshooting time for something that looked like it should just work.
This commit is contained in:
+15
-3
@@ -887,10 +887,15 @@ UDEV
|
||||
local _GET_AMX=""
|
||||
prompt_yn "Set up AntiMicroX for a universal controller hotkey? (y/n):" "n" _GET_AMX
|
||||
if [[ "$_GET_AMX" =~ ^[Yy]$ ]]; then
|
||||
# Real release asset is "AntiMicroX-x86_64.AppImage" (capitalized) —
|
||||
# confirmed against the actual GitHub release, not assumed. A plain
|
||||
# lowercase glob (like Azahar's/PCSX2's, which really are lowercase)
|
||||
# would silently never match this one, on both the helper's own
|
||||
# already-downloaded check and the lookup below.
|
||||
_wolf_download_emulator_appimage \
|
||||
"AntiMicroX" "AntiMicroX/antimicrox" "antimicrox*.AppImage" "$_AMX_DIR"
|
||||
"AntiMicroX" "AntiMicroX/antimicrox" "[Aa]nti[Mm]icro[Xx]*.AppImage" "$_AMX_DIR"
|
||||
local _AMX_APP
|
||||
_AMX_APP=$(ls "$_AMX_DIR"/antimicrox*.AppImage 2>/dev/null | head -1)
|
||||
_AMX_APP=$(ls "$_AMX_DIR"/[Aa]nti[Mm]icro[Xx]*.AppImage 2>/dev/null | head -1)
|
||||
if [[ -n "$_AMX_APP" ]]; then
|
||||
backup_if_exists "$_SWAY_CFG_DIR/custom-cfg"
|
||||
cat > "$_SWAY_CFG_DIR/custom-cfg" << CFGEOF
|
||||
@@ -898,7 +903,14 @@ UDEV
|
||||
# Launched as a normal floating window (not hidden) so its own GUI is
|
||||
# reachable through the Moonlight stream for one-time profile setup —
|
||||
# see ~/docker/wolf/README.md for how to build the actual button mapping.
|
||||
for_window [app_id="antimicrox"] floating enable, resize set 480 360, move position 20 20
|
||||
#
|
||||
# AntiMicroX is a Qt5/X11 app running under XWayland here, same as ES-DE and
|
||||
# Steam in this same stock config (see their own [class="..."] rules above) —
|
||||
# app_id only matches native Wayland clients and would never match this one.
|
||||
# Matched on both class and title as a fallback in case the exact WM_CLASS
|
||||
# AntiMicroX registers turns out to differ from what's assumed here.
|
||||
for_window [class="(?i)antimicrox"] floating enable, resize set 480 360, move position 20 20
|
||||
for_window [title="(?i)antimicrox"] floating enable, resize set 480 360, move position 20 20
|
||||
exec /home/retro/.config/antimicrox/$(basename "$_AMX_APP") --appimage-extract-and-run &
|
||||
CFGEOF
|
||||
chown -R 1000:1000 "$_AMX_DIR" "$_SWAY_CFG_DIR" 2>/dev/null || true
|
||||
|
||||
Reference in New Issue
Block a user