1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-28 21:32:36 +01:00

fix: harden client targeting function (#60)

This commit is contained in:
aclist 2023-05-10 11:49:17 +09:00
parent 0cabcb9f46
commit 3015eb729a
2 changed files with 11 additions and 6 deletions

View file

@ -5,6 +5,10 @@
- Custom query API
- Standardize dialogs
## [3.3.0-rc.21] 2023-05-10
### Fixed
- Hardening of beta client targeting function to avoid false positives
## [3.3.0-rc.20] 2023-05-09
### Changed
- Use same WM_CLASS targeting method for beta and stable clients

View file

@ -1032,13 +1032,14 @@ is_beta(){
fi
}
focus_beta_client(){
until [[ -z $(wmctrl -lG | grep "Steam Games List") ]]; do
sleep 0.1s
wid(){
wmctrl -ilx | awk 'tolower($3) == "steam.steam"' | grep 'Steam$' | awk '{print $1}'
}
until [[ -n $(wid) ]]; do
:
done
until [[ -n $(wmctrl -lG | grep "Steam Games List") ]]; do
sleep 0.1s
done
wmctrl -a "Steam Games List"
wmctrl -ia $(wid)
sleep 0.1s
wid=$(xdotool getactivewindow)
local geo=$(xdotool getwindowgeometry $wid)
local pos=$(<<< "$geo" awk 'NR==2 {print $2}' | sed 's/,/ /')