Created
April 16, 2025 06:44
-
-
Save natholdallas/fcf27a577da92e15b3c9bdcf99711022 to your computer and use it in GitHub Desktop.
Fix steam path accord with XDG standard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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 "$@" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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