1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-29 13:52:03 +01:00

fix(flatpak): use longform of command

This commit is contained in:
aclist 2023-01-20 01:55:41 +09:00
parent 6057314fe7
commit 17930e4e6a

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -o pipefail set -o pipefail
version=3.3.0-rc.3 version=3.3.0-rc.4
aid=221100 aid=221100
game="dayz" game="dayz"
@ -196,7 +196,7 @@ staging_dir="$staging_dir"
default_steam_path="$default_steam_path" default_steam_path="$default_steam_path"
#Preferred Steam launch command (for Flatpak support) #Preferred Steam launch command (for Flatpak support)
sbp_cmd="$sbp_cmd" preferred_client="$preferred_client"
END END
} }
write_desktop_file(){ write_desktop_file(){
@ -343,7 +343,7 @@ steam_deck_mods(){
rc=$? rc=$?
if [[ $rc -eq 0 ]]; then if [[ $rc -eq 0 ]]; then
echo "[DZGUI] Opening ${workshop}$next" echo "[DZGUI] Opening ${workshop}$next"
"$sbp_cmd" steam://url/CommunityFilePage/$next 2>/dev/null & "$steam_cmd" steam://url/CommunityFilePage/$next 2>/dev/null &
$steamsafe_zenity --info --title="DZGUI" --ok-label="Next" --text="Click [Next] to continue mod check." --width=500 2>/dev/null $steamsafe_zenity --info --title="DZGUI" --ok-label="Next" --text="Click [Next] to continue mod check." --width=500 2>/dev/null
else else
return 1 return 1
@ -383,7 +383,7 @@ manual_mod_install(){
[[ -f $ex ]] && return 1 [[ -f $ex ]] && return 1
local downloads_dir="$steam_path/steamapps/workshop/downloads/$aid" local downloads_dir="$steam_path/steamapps/workshop/downloads/$aid"
local workshop_dir="$steam_path/steamapps/workshop/content/$aid" local workshop_dir="$steam_path/steamapps/workshop/content/$aid"
"$sbp_cmd" "steam://url/CommunityFilePage/${stage_mods[$i]}" "$steam_cmd" "steam://url/CommunityFilePage/${stage_mods[$i]}"
echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress after subscribing, try unsubscribing and resubscribing again until the download commences." echo "# Opening workshop page for ${stage_mods[$i]}. If you see no progress after subscribing, try unsubscribing and resubscribing again until the download commences."
sleep 1s sleep 1s
foreground foreground
@ -470,7 +470,7 @@ auto_mod_install(){
[[ -f "/tmp/dz.status" ]] && rm "/tmp/dz.status" [[ -f "/tmp/dz.status" ]] && rm "/tmp/dz.status"
touch "/tmp/dz.status" touch "/tmp/dz.status"
console_dl "$diff" && console_dl "$diff" &&
"$sbp_cmd" steam://open/downloads && 2>/dev/null 1>&2 "$steam_cmd" steam://open/downloads && 2>/dev/null 1>&2
win=$(xdotool search --name "DZG Watcher") win=$(xdotool search --name "DZG Watcher")
xdotool windowactivate $win xdotool windowactivate $win
until [[ -z $(comm -23 <(printf "%s\n" "${modids[@]}" | sort) <(ls -1 $workshop_dir | sort)) ]]; do until [[ -z $(comm -23 <(printf "%s\n" "${modids[@]}" | sort) <(ls -1 $workshop_dir | sort)) ]]; do
@ -1098,19 +1098,15 @@ force_update_mods(){
fi fi
} }
toggle_steam_binary(){ toggle_steam_binary(){
case $sbp_cmd in case "$steam_cmd" in
steam) steam)
sbp_cmd="xdg-open"
steam_cmd="flatpak run com.valvesoftware.Steam" steam_cmd="flatpak run com.valvesoftware.Steam"
preferred_client=$sbp_cmd update_steam_cmd
update_sbp_cmd
popup 700 popup 700
;; ;;
xdg-open) flatpak*)
sbp_cmd="steam"
steam_cmd="steam" steam_cmd="steam"
preferred_client=$sbp_cmd update_steam_cmd
update_sbp_cmd
popup 800;; popup 800;;
esac esac
} }
@ -1127,9 +1123,9 @@ options_menu(){
) )
#TODO: tech debt: drop old flags #TODO: tech debt: drop old flags
[[ $auto_install -eq 2 ]] || [[ $auto_install -eq 1 ]] && debug_list+=("Force update local mods") [[ $auto_install -eq 2 ]] || [[ $auto_install -eq 1 ]] && debug_list+=("Force update local mods")
case $sbp_cmd in case "$steam_cmd" in
steam) steam_hr=Steam ;; steam) steam_hr=Steam ;;
xdg-open) steam_hr=Flatpak ;; flatpak*) steam_hr=Flatpak ;;
esac esac
[[ $toggle_steam -eq 1 ]] && debug_list+=("Toggle native Steam or Flatpak [$steam_hr]") [[ $toggle_steam -eq 1 ]] && debug_list+=("Toggle native Steam or Flatpak [$steam_hr]")
debug_sel=$($steamsafe_zenity --list --width=1280 --height=800 --column="Options" --title="DZGUI" --hide-header "${debug_list[@]}" 2>/dev/null) debug_sel=$($steamsafe_zenity --list --width=1280 --height=800 --column="Options" --title="DZGUI" --hide-header "${debug_list[@]}" 2>/dev/null)
@ -1777,8 +1773,9 @@ fetch_helpers(){
mkdir -p "$helpers_path" mkdir -p "$helpers_path"
[[ ! -f "$helpers_path/vdf2json.py" ]] && curl -Ls "$vdf2json_url" > "$helpers_path/vdf2json.py" [[ ! -f "$helpers_path/vdf2json.py" ]] && curl -Ls "$vdf2json_url" > "$helpers_path/vdf2json.py"
} }
update_sbp_cmd(){ update_steam_cmd(){
local new_cmd local new_cmd
preferred_client="$steam_cmd"
new_cmd="preferred_client=\"$preferred_client\"" new_cmd="preferred_client=\"$preferred_client\""
mv $config_file ${config_path}dztuirc.old mv $config_file ${config_path}dztuirc.old
nr=$(awk '/preferred_client=/ {print NR}' ${config_path}dztuirc.old) nr=$(awk '/preferred_client=/ {print NR}' ${config_path}dztuirc.old)
@ -1793,15 +1790,12 @@ steam_deps(){
exit exit
elif [[ -n "$steam" ]] && [[ -n "$flatpak" ]]; then elif [[ -n "$steam" ]] && [[ -n "$flatpak" ]]; then
toggle_steam=1 toggle_steam=1
sbp_cmd="steam"
steam_cmd="steam" steam_cmd="steam"
[[ -n $preferred_client ]] && sbp_cmd=$preferred_client [[ -n $preferred_client ]] && steam_cmd="$preferred_client"
[[ -z $preferred_client ]] && { preferred_client=$sbp_cmd; update_sbp_cmd; } [[ -z $preferred_client ]] && update_steam_cmd
elif [[ -n "$steam" ]]; then elif [[ -n "$steam" ]]; then
sbp_cmd="steam"
steam_cmd="steam" steam_cmd="steam"
else else
sbp_cmd="xdg-open"
steam_cmd="flatpak run com.valvesoftware.Steam" steam_cmd="flatpak run com.valvesoftware.Steam"
fi fi
} }