Commit 6d45f4f0 authored by Alex Smith's avatar Alex Smith

add_in_steam: findLastUserId

parent 2a94a94a
......@@ -5780,6 +5780,27 @@ portwine_output_yad_shortcut () {
fi
if [[ "${PW_SHORTCUT_STEAM}" == "TRUE" ]] ; then
SLUF="${HOME}/.local/share/Steam/config/loginusers.vdf"
if [[ -f "${SLUF}" ]]; then
SLUFUB=false
STUID64=""
while IFS= read -r line; do
if [[ "${line}" =~ ^[[:space:]]*\"([0-9]+)\"$ ]]; then
STUIDCUR="${BASH_REMATCH[1]}"
SLUFUB=true
elif [[ "${line}" == *'"MostRecent"'*'"1"' && ${SLUFUB} = true ]]; then
STUID64="${STUIDCUR}"
break
elif [[ "${line}" == "}" ]]; then
SLUFUB=false
fi
done < "${SLUF}"
if [ -n "${STUID64}" ]; then
STUID32=$((STUID64 - 76561197960265728))
STUIDPATH="${HOME}/.local/share/Steam/userdata/${STUID32}"
if [[ -d "${STUIDPATH}" ]]; then
export SCPATH="${STUIDPATH}/config/shortcuts.vdf"
if [[ -f "${SCPATH}" ]]; then
export STEAM_SCRIPTS="${PORT_WINE_PATH}/steam_scripts"
create_new_dir "${STEAM_SCRIPTS}"
echo "#!/usr/bin/env bash" > "${STEAM_SCRIPTS}/${name_desktop}.sh"
......@@ -5790,18 +5811,10 @@ portwine_output_yad_shortcut () {
else echo "\"${PORT_SCRIPTS_PATH}/start.sh\" \"${portwine_exe}\" " >> "${STEAM_SCRIPTS}/${name_desktop}.sh"
fi
chmod u+x "${STEAM_SCRIPTS}/${name_desktop}.sh"
export SCVDF="shortcuts.vdf"
for STUIDPATH in "${HOME}"/.local/share/Steam/userdata/*/; do
if [[ -d "$STUIDPATH" ]]; then
create_new_dir "${STUIDPATH}config/"
create_new_dir "${STUIDPATH}config/grid"
export SCPATH="${STUIDPATH}config/$SCVDF"
export SGGRIDDIR="${STUIDPATH}config/grid"
# shellcheck source=/dev/null
create_new_dir "${STUIDPATH}/config/"
create_new_dir "${STUIDPATH}/config/grid"
export SGGRIDDIR="${STUIDPATH}/config/grid"
source "${PORT_SCRIPTS_PATH}/add_in_steam.sh"
fi
done
if [[ "${PW_SKIP_RESTART_STEAM}" != 1 ]] && pgrep -i steam &>/dev/null ; then
if yad_question "${translations[For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?]}" ; then
pw_start_progress_bar_block "${translations[Restarting STEAM... Please wait.]}"
......@@ -5817,6 +5830,10 @@ portwine_output_yad_shortcut () {
fi
unset PW_SKIP_RESTART_STEAM
fi
fi
fi
fi
fi
export PW_NEW_DESKTOP="1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment