Skip to content

Instantly share code, notes, and snippets.

@natholdallas
Created April 16, 2025 06:44
Show Gist options
  • Select an option

  • Save natholdallas/fcf27a577da92e15b3c9bdcf99711022 to your computer and use it in GitHub Desktop.

Select an option

Save natholdallas/fcf27a577da92e15b3c9bdcf99711022 to your computer and use it in GitHub Desktop.
Fix steam path accord with XDG standard
#! /usr/bin/bash
export fake_home="$XDG_DATA_HOME/Steam/home"
mkdir -p "$fake_home"
link_home_file() {
link_name="${1/#$HOME/$fake_home}"
if [[ ! -e "$link_name" ]]; then
ln -s "$1" "$link_name"
fi
}
# Remove all dead links if not link to fake_home$
for file in "$fake_home"/{*,.*}; do
[[ -L "$file" ]] || continue
if [[ $(readlink "$file") != "$fake_home"/* ]] && [[ ! -e "$file" ]]; then
unlink "$file"
fi
done
# Link all files in $HOME to fake_home$
for file in "$HOME"/{*,.*}; do
link_home_file "$file"
done
# Run
_JAVA_OPTIONS="-Duser.home=$fake_home $_JAVA_OPTIONS" HOME=$fake_home exec "$@"
@natholdallas
Copy link
Author

put it in your $PATH, and you can execute steam with command "steamfix steam" or you can create desktop file, bin, wrapper command, anyway you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment