1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +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 - Custom query API
- Standardize dialogs - 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 ## [3.3.0-rc.20] 2023-05-09
### Changed ### Changed
- Use same WM_CLASS targeting method for beta and stable clients - Use same WM_CLASS targeting method for beta and stable clients

View file

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