From 03c47c3b55a493cd83d86ea3c893a355f3e15b66 Mon Sep 17 00:00:00 2001 From: aclist Date: Tue, 9 May 2023 05:52:29 +0900 Subject: [PATCH] fix: better client targeting (#60) --- changelog.md | 5 +++++ dzgui.sh | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index a635b83..2bab3a2 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,11 @@ - Custom query API - Standardize dialogs +## [3.3.0-rc.18] 2023-05-09 +### Changed +- More robust targeting of Steam client +- Change method of issuing console commands to Beta client + ## [3.3.0-rc.17] 2023-05-07 ### Fixed - Use sudo when checking vm map count (#61) diff --git a/dzgui.sh b/dzgui.sh index 5fd6344..9af7b10 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o pipefail -version=3.3.0-rc.16 +version=3.3.0-rc.18 aid=221100 game="dayz" @@ -88,9 +88,9 @@ depcheck(){ done } watcher_deps(){ - if [[ ! $(command -v wmctrl) ]] && [[ ! $(command -v xdotool) ]]; then + if [[ ! $(command -v wmctrl) ]] || [[ ! $(command -v xdotool) ]]; then echo "100" - warn "Missing dependency: requires 'wmctrl' or 'xdotool'.\nInstall from your system's package manager." + warn "Missing dependency: requires 'wmctrl' and 'xdotool'.\nInstall from your system's package manager." exit 1 fi } @@ -560,7 +560,11 @@ update_history(){ echo -e "${old}${ip}" > "$hist_file" } is_steam_running(){ - xdotool search --onlyvisible --name "Steam" + if [[ $(is_beta) -eq 0 ]]; then + wmctrl -l | grep "Steam Games List" + else + wmctrl -ilx | awk '$3 == "Steam.Steam"' + fi } connect(){ #TODO: sanitize/validate input @@ -1075,7 +1079,7 @@ console_dl(){ fi xdotool type --delay 0 "workshop_download_item $aid $i" sleep 0.5s - xdotool key --window $wid Return + xdotool key Return sleep 0.5s done }