diff --git a/dzgui.sh b/dzgui.sh index 43f921b..0b33ffd 100755 --- a/dzgui.sh +++ b/dzgui.sh @@ -1,7 +1,7 @@ #!/bin/bash set -o pipefail -version=2.7.0-rc.26 +version=2.8.0-rc.1 aid=221100 game="dayz" @@ -173,15 +173,12 @@ steam_api="$steam_api" #Terminal emulator term="$term" -<<<<<<< Updated upstream -======= #Auto-install mods auto_install="$auto_install" #Automod staging directory staging_dir="/tmp" ->>>>>>> Stashed changes END } write_desktop_file(){ @@ -369,18 +366,11 @@ set_term(){ source $config_file } sel_term(){ -<<<<<<< Updated upstream - #only terminals known to support -e flag -======= ->>>>>>> Stashed changes if [[ $is_steam_deck -eq 1 ]]; then set_term konsole return 0 fi -<<<<<<< Updated upstream -======= #only terminals known to support -e flag ->>>>>>> Stashed changes for i in "$TERMINAL" urxvt alacritty konsole gnome-terminal terminator xfce4-terminal xterm st tilix; do [[ $(command -v $i) ]] && terms+=($i) done @@ -389,24 +379,13 @@ sel_term(){ term=$(echo "$terms" | zenity --list --column=Terminal --height=800 --width=1200 --text="Select your preferred terminal emulator to run steamcmd (setting will be saved)" --title=DZGUI) } auto_mod_install(){ -<<<<<<< Updated upstream -# disksize=$(df $staging_dir --output=avail | tail -n1) -# bytewise=$((disksize * 1024)) -# hr=$(echo $(numfmt --to=iec --format "%8.1f" $bytewise $totalmodsize) | sed 's/ /\//') -# if [[ $totalmodsize -gt $bytewise ]]; then printf "[ERROR] Not enough space in /tmp to automatically stage mods: %s\n" $hr -======= [[ ! $auto_install -eq 1 ]] && return 1 ->>>>>>> Stashed changes cmd=$(printf "%q " "$@") if [[ -z "$term" ]]; then sel_term && set_term "$term" fi echo "[DZGUI] Kicking off auto mod script" -<<<<<<< Updated upstream - $term -e bash -c "/$helpers_path/scmd.sh $cmd" -======= $term -e bash -c "/$helpers_path/scmd.sh $totalmodsize $cmd" ->>>>>>> Stashed changes compare if [[ -z $diff ]]; then passed_mod_check > >(zenity --pulsate --progress --auto-close --width=500 2>/dev/null) @@ -477,7 +456,6 @@ passed_mod_check(){ legacy_symlinks symlinks echo "100" - launch } connect(){ @@ -508,6 +486,7 @@ connect(){ [[ $rc -eq 1 ]] && manual_mod_install else passed_mod_check > >(zenity --pulsate --progress --auto-close --width=500 2>/dev/null) + launch fi } fetch_mods(){ @@ -660,19 +639,10 @@ query_defunct(){ post(){ curl -s -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "$(payload)" 'https://api.steampowered.com/ISteamRemoteStorage/GetPublishedFileDetails/v1/?format=json' } -<<<<<<< Updated upstream - readarray -t newlist <<< $(post | jq -r '.[].publishedfiledetails[] | select(.result==1) .publishedfileid') - #FIXME: - #result=$(post | jq -r '.[].publishedfiledetails[] | select(.result==1) | "\(.file_size) \(.publishedfileid)"') - #readarray -t newlist <<< $(echo -e "$result" | awk '{print $2}') - #totalmodsize=$(echo -e "$result" | awk '{s+=$1}END{print s}') - #prompt to proceed anyway -======= result=$(post | jq -r '.[].publishedfiledetails[] | select(.result==1) | "\(.file_size) \(.publishedfileid)"') totalmodsize=$(echo -e "$result" | awk '{s+=$1}END{print s}') readarray -t newlist <<< $(echo -e "$result" | awk '{print $2}') #readarray -t newlist <<< $(post | jq -r '.[].publishedfiledetails[] | select(.result==1) .publishedfileid') ->>>>>>> Stashed changes } validate_mods(){ url="https://steamcommunity.com/sharedfiles/filedetails/?id=" @@ -1378,7 +1348,7 @@ enforce_dl(){ download_new_version > >(zenity --progress --pulsate --auto-close --no-cancel --width=500) } prompt_dl(){ - zenity --question --title="DZGUI" --text "Version conflict.\n\nYour branch:\t\t\t$branch\nYour version\t\t\t$version\nUpstream version:\t\t$upstream\n\nVersion updates introduce important bug fixes and are encouraged.\n\nAttempt to download latest version?" --width=500 --ok-label="Yes" --cancel-label="No" 2>/dev/null + zenity --question --title="DZGUI" --text "Version conflict.\n\nYour branch:\t\t$branch\nYour version\t\t$version\nUpstream version:\t\t$upstream\n\nVersion updates introduce important bug fixes and are encouraged.\n\nAttempt to download latest version?" --width=500 --ok-label="Yes" --cancel-label="No" 2>/dev/null rc=$? if [[ $rc -eq 1 ]]; then return