added additional directory check for loginusers for desktop

This commit is contained in:
Roy 2024-05-19 00:01:22 -07:00 committed by GitHub
parent f019efd984
commit 07a73e9f72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2329,16 +2329,20 @@ export PYTHONPATH="${download_dir}/lib/python${python_version}/site-packages/:$P
# Set the default Steam directory # Set the default Steam directory
steam_dir="${logged_in_home}/.local/share/Steam" steam_dir="${logged_in_home}/.local/share/Steam"
# Check if the loginusers.vdf file exists in the original directory
# Check if the loginusers.vdf file exists
if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then
# Extract the block of text for the most recent user # Extract the block of text for the most recent user
most_recent_user=$(sed -n '/"users"/,/"MostRecent" "1"/p' "${logged_in_home}/.steam/root/config/loginusers.vdf") most_recent_user=$(sed -n '/"users"/,/"MostRecent" "1"/p' "${logged_in_home}/.steam/root/config/loginusers.vdf")
elif [[ -f "${logged_in_home}/.local/share/Steam/config/loginusers.vdf" ]]; then
# If the file is not in the original directory, check the additional directory
most_recent_user=$(sed -n '/"users"/,/"MostRecent" "1"/p' "${logged_in_home}/.local/share/Steam/config/loginusers.vdf")
fi
# Initialize variables
max_timestamp=0
current_user=""
current_steamid=""
# Initialize variables
max_timestamp=0
current_user=""
current_steamid=""
# Process each user block # Process each user block
# Set IFS to only look for Commas to avoid issues with Whitespace in older account names. # Set IFS to only look for Commas to avoid issues with Whitespace in older account names.