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

Streamline progress notifier

This commit is contained in:
aclist 2022-10-26 14:26:06 +09:00
parent 079e20e49f
commit 77bd6bdf9c
2 changed files with 10 additions and 20 deletions

View file

@ -5,6 +5,10 @@
- Custom query API
- Standardize dialogs
## [3.1.0-rc.7] 2022-10-25
### Changed
- Simplify mod progress watcher
## [3.1.0-rc.6] 2022-10-25
### Fixed
- Download mod metadata

View file

@ -1,7 +1,7 @@
#!/bin/bash
set -o pipefail
version=3.1.0-rc.6
version=3.1.0-rc.7
aid=221100
game="dayz"
@ -542,12 +542,12 @@ auto_mod_install(){
log="$default_steam_path/logs/content_log.txt"
[[ -f "/tmp/dz.status" ]] && rm "/tmp/dz.status"
touch "/tmp/dz.status"
depot_watcher "$diff" &
console_dl "$diff" &&
steam steam://open/downloads 2>/dev/null 1>&2
until [[ $(tail -n1 "/tmp/dz.status") =~ "Finished" ]]; do
sleep 0.1s
done
steam steam://open/downloads && 2>/dev/null 1>&2
until [[ -z $(comm -23 <(printf "%s\n" "${modids[@]}" | sort) <(ls -1 $workshop_dir | sort)) ]]; do
local missing=$(comm -23 <(printf "%s\n" "${modids[@]}" | sort) <(ls -1 $workshop_dir | sort) | wc -l)
echo "# Downloaded $((${#modids[@]}-missing)) of ${#modids[@]} mods"
done | zenity --pulsate --progress --title=DZGUI --auto-close --no-cancel --width=500 2>/dev/null
compare
if [[ -z $diff ]]; then
check_timestamps
@ -1059,20 +1059,6 @@ toggle_headless(){
[[ $is_steam_deck -eq 1 ]] && big_prompt="--width=800"
[[ $auto_install == "1" ]] && zenity --info --text="$(automods_prompt)" $big_prompt 2>/dev/null
}
depot_watcher(){
readarray -t watched_mods <<< "$@"
for i in "${watched_mods[@]}"; do
echo "[DZGUI] Downloading mod $i"
until [[ -d "$workshop_dir/$i" ]]; do
sleep 0.1s
done
until [[ "$(tail -n1 $log)" =~ AppID[[:space:]]221100[[:space:]]scheduler[[:space:]]finished ]]; do
sleep 0.1s
done
done
echo "Finished" >> "/tmp/dz.status"
return 0
}
console_dl(){
readarray -t modids <<< "$@"
steam steam://open/console 2>/dev/null 1>&2