1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

fix: better client targeting (#60)

This commit is contained in:
aclist 2023-05-09 05:52:29 +09:00
parent 89242bcdbd
commit 03c47c3b55
2 changed files with 14 additions and 5 deletions

View file

@ -5,6 +5,11 @@
- Custom query API - Custom query API
- Standardize dialogs - 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 ## [3.3.0-rc.17] 2023-05-07
### Fixed ### Fixed
- Use sudo when checking vm map count (#61) - Use sudo when checking vm map count (#61)

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -o pipefail set -o pipefail
version=3.3.0-rc.16 version=3.3.0-rc.18
aid=221100 aid=221100
game="dayz" game="dayz"
@ -88,9 +88,9 @@ depcheck(){
done done
} }
watcher_deps(){ watcher_deps(){
if [[ ! $(command -v wmctrl) ]] && [[ ! $(command -v xdotool) ]]; then if [[ ! $(command -v wmctrl) ]] || [[ ! $(command -v xdotool) ]]; then
echo "100" 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 exit 1
fi fi
} }
@ -560,7 +560,11 @@ update_history(){
echo -e "${old}${ip}" > "$hist_file" echo -e "${old}${ip}" > "$hist_file"
} }
is_steam_running(){ 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(){ connect(){
#TODO: sanitize/validate input #TODO: sanitize/validate input
@ -1075,7 +1079,7 @@ console_dl(){
fi fi
xdotool type --delay 0 "workshop_download_item $aid $i" xdotool type --delay 0 "workshop_download_item $aid $i"
sleep 0.5s sleep 0.5s
xdotool key --window $wid Return xdotool key Return
sleep 0.5s sleep 0.5s
done done
} }