mirror of
https://github.com/aclist/dztui.git
synced 2025-04-04 19:43:00 +02:00
fix: restore beta client logic
This commit is contained in:
parent
98f816c89d
commit
ea2c5291a5
1 changed files with 49 additions and 7 deletions
56
dzgui.sh
56
dzgui.sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -o pipefail
|
||||
version=3.3.0-rc.25
|
||||
version=3.3.0-rc.26
|
||||
|
||||
aid=221100
|
||||
game="dayz"
|
||||
|
@ -1014,6 +1014,38 @@ toggle_branch(){
|
|||
printf "[DZGUI] Toggled branch to '$branch'\n"
|
||||
source $config_file
|
||||
}
|
||||
is_beta(){
|
||||
local dir="$default_steam_path/package"
|
||||
if [[ -f $dir/beta ]]; then
|
||||
echo 0
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
focus_beta_client(){
|
||||
wid(){
|
||||
wmctrl -ilx | awk 'tolower($3) == "steam.steam"' | grep 'Steam$' | awk '{print $1}'
|
||||
}
|
||||
until [[ -n $(wid) ]]; do
|
||||
:
|
||||
done
|
||||
wmctrl -ia $(wid)
|
||||
sleep 0.1s
|
||||
wid=$(xdotool getactivewindow)
|
||||
local geo=$(xdotool getwindowgeometry $wid)
|
||||
local pos=$(<<< "$geo" awk 'NR==2 {print $2}' | sed 's/,/ /')
|
||||
local dim=$(<<< "$geo" awk 'NR==3 {print $2}' | sed 's/x/ /')
|
||||
local pos1=$(<<< "$pos" awk '{print $1}')
|
||||
local pos2=$(<<< "$pos" awk '{print $2}')
|
||||
local dim1=$(<<< "$dim" awk '{print $1}')
|
||||
local dim2=$(<<< "$dim" awk '{print $2}')
|
||||
local dim1=$(((dim1/2)+pos1))
|
||||
local dim2=$(((dim2/2)+pos2))
|
||||
xdotool mousemove $dim1 $dim2
|
||||
xdotool click 1
|
||||
sleep 0.5s
|
||||
xdotool key Tab
|
||||
}
|
||||
generate_log(){
|
||||
cat <<-DOC
|
||||
Linux: $(uname -mrs)
|
||||
|
@ -1034,14 +1066,24 @@ console_dl(){
|
|||
sleep 1s
|
||||
#https://github.com/jordansissel/xdotool/issues/67
|
||||
#https://dwm.suckless.org/patches/current_desktop/
|
||||
local wid=$(xdotool search --onlyvisible --name Steam)
|
||||
#xdotool windowactivate $wid
|
||||
sleep 1.5s
|
||||
for i in "${modids[@]}"; do
|
||||
xdotool type --delay 0 "workshop_download_item $aid $i"
|
||||
sleep 0.5s
|
||||
xdotool key --window $wid Return
|
||||
sleep 0.5s
|
||||
if [[ $(is_beta) -eq 0 ]]; then
|
||||
if [[ ${#modids[@]} -eq 1 ]]; then
|
||||
focus_beta_client
|
||||
fi
|
||||
else
|
||||
wid=0
|
||||
until [[ $(xdotool getwindowname $wid 2>/dev/null) == "Steam" ]]; do
|
||||
wid=$(xdotool getactivewindow)
|
||||
done
|
||||
xdotool windowfocus $wid
|
||||
xdotool key Tab
|
||||
fi
|
||||
xdotool type --delay 0 "workshop_download_item $aid $i"
|
||||
sleep 0.5s
|
||||
xdotool key Return
|
||||
sleep 0.5s
|
||||
done
|
||||
}
|
||||
find_default_path(){
|
||||
|
|
Loading…
Reference in a new issue