mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
Calculate mod sizes
This commit is contained in:
parent
b761e3aef6
commit
b1929019a6
1 changed files with 8 additions and 1 deletions
9
dzgui.sh
9
dzgui.sh
|
@ -379,6 +379,12 @@ sel_term(){
|
||||||
local terms=$(printf "%s\n" "${terms[@]}" | sort -u)
|
local terms=$(printf "%s\n" "${terms[@]}" | sort -u)
|
||||||
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 2>/dev/null)
|
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 2>/dev/null)
|
||||||
}
|
}
|
||||||
|
calc_mod_sizes(){
|
||||||
|
for i in "$diff"; do
|
||||||
|
local mods+=$(grep "$i" /tmp/modsizes | awk '{print $1}')
|
||||||
|
done
|
||||||
|
totalmodsize=$(echo -e "${mods[@]}" | awk '{s+=$1}END{print s}')
|
||||||
|
}
|
||||||
auto_mod_install(){
|
auto_mod_install(){
|
||||||
cmd=$(printf "%q " "$@")
|
cmd=$(printf "%q " "$@")
|
||||||
if [[ -z "$term" ]]; then
|
if [[ -z "$term" ]]; then
|
||||||
|
@ -386,6 +392,7 @@ auto_mod_install(){
|
||||||
fi
|
fi
|
||||||
[[ -z "$term" ]] && return 1
|
[[ -z "$term" ]] && return 1
|
||||||
echo "[DZGUI] Kicking off auto mod script"
|
echo "[DZGUI] Kicking off auto mod script"
|
||||||
|
calc_mod_sizes
|
||||||
$term -e bash -c "/$helpers_path/scmd.sh $totalmodsize $cmd"
|
$term -e bash -c "/$helpers_path/scmd.sh $totalmodsize $cmd"
|
||||||
compare
|
compare
|
||||||
if [[ -z $diff ]]; then
|
if [[ -z $diff ]]; then
|
||||||
|
@ -646,7 +653,7 @@ query_defunct(){
|
||||||
curl -s -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "$(payload)" 'https://api.steampowered.com/ISteamRemoteStorage/GetPublishedFileDetails/v1/?format=json'
|
curl -s -X POST -H "Content-Type:application/x-www-form-urlencoded" -d "$(payload)" 'https://api.steampowered.com/ISteamRemoteStorage/GetPublishedFileDetails/v1/?format=json'
|
||||||
}
|
}
|
||||||
result=$(post | jq -r '.[].publishedfiledetails[] | select(.result==1) | "\(.file_size) \(.publishedfileid)"')
|
result=$(post | jq -r '.[].publishedfiledetails[] | select(.result==1) | "\(.file_size) \(.publishedfileid)"')
|
||||||
totalmodsize=$(echo -e "$result" | awk '{s+=$1}END{print s}')
|
echo "$result" > /tmp/modsizes
|
||||||
readarray -t newlist <<< $(echo -e "$result" | awk '{print $2}')
|
readarray -t newlist <<< $(echo -e "$result" | awk '{print $2}')
|
||||||
}
|
}
|
||||||
validate_mods(){
|
validate_mods(){
|
||||||
|
|
Loading…
Reference in a new issue