-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Follow XDG Base Directory Specification #1890
Comments
As far as I can see, ~/.steam is just a symlink to ~/.local/share/Steam Imho there should be an option to disable the recreation of ~/.steam. |
Actually ~/.Steam seems to be a real directory for me, but it contains mostly links. Should be in ~/.config/Steam (or whatever XDG is set to: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html ). There are also ~/.steampid and ~/.steampath links created all adding to home folder pollution. |
It's a little sad this has received little attention. Steam still creates ~/.steampath, ~/.steampid and ~/.steam full of symlinks instead of fully using the xdg basedir spec. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html |
Steam still not properly implementing XDG basespecs. thanks for more shit in my home folder. |
For what it's worth, I dealt with this by setting $HOME in $XDG_RUNTIME_DIR. For anyone interested in the code, here's the link. |
No updates yet? How hard is to follow the XDG basespecs? |
As an addendum, steam seems to partially implement it for at least the overlay since vulkan came about. However, the spec specificially...specifies...that all the XDG dirs are variables, and Steam always creates $HOME/.local/share/vulkan/implicit_layer.d/steamoverlay_{i386,x86_64}.json even if XDG_DATA_HOME is set to another location (in this case $HOME/local/data). |
+1 |
Since after all these years, Steam still creates no fewer than 4 garbage files in $HOME, a non-optimal workaround is to create a wrapper for steam:
This also has the beneficial side effect of fooling any rude game devs that follow Valve's example because they either don't know any better or just have a philosophical appreciation for slovenliness. |
this sucks. please fix this, I dont want any of this garbage in my home folder |
The steam Linux client is in dire need of many QOL fixes, this being a big one. |
Hi, I'm sure another bump here won't do much but I'll go ahead and do it anyway and see if maybe I can poke some of my valve contacts to take a look at this. |
If these files are needed for older games. Why not just create them when you install the old game? |
I have been waiting this feature for years. I'm really grateful for what steam has done for linux gaming and nobody can deny that. But steam you also have to look at what people are requesting out here and should try to follow the linux way instead of other way around. I'm hopeful that after this crisis is over you would give a serious consideration for following the standard XDG_BASE_DIRECTORY |
Just piling on here to point out this still hasn't been changed. Emacs is something like 40 years old, and their next release will support XDG Base Directory configuration. Valve can do this. |
come on....... follow specs |
It's bad enough when a program create 1 dotfile/directory in $HOME, but three? And two of them are symlinks? Follow specs. |
Yeah, its funny how valve created proton so that almost any windows game runs flawless in linux. |
This issue was opened in 2013. 7 years have passed and Steam is still cluttering our ~/home with .steam directory instead of following XDG standard. :( |
I thank Valve for all the effort they put into making things work on Linux. |
Come on, this is an easy issue to fix. Can't take 7 years to address. |
@GotaLoveFiraCode i shed a tear reading this 😢 |
Its weird for me that people dont give a ding dong about what sense there is to request xdg support. How is there any benefit to even consider it. Moving 3-4 hidden files to some dir with no benefit other than it being nice and it even being worth risking anything at all. |
@foololol it wouldn't be that hard? it's probably written in c++, so it would be as simple as: if( getenv("STEAM_HOME" ) {
let steam_dir = /* The value of STEAM_HOME */;
} else {
let steam_dir = "$HOME/.steam";
} |
You do know that its not only steam running when you run a game ? wtf |
There have been numerous shims presented in this thread that almost acheive the desired support minus some pendantics about what belong in CONFIG and what belongs in DATA. I have been using a launch script that sets HOME=$XDG_DATA_HOME/steamhome before launching steam and it breaks absolutely 0 functionality. The bare minimum Valve could do is an officially supported variation on that pattern. It's MY home directory, not Valve's. |
I did not know that. Whats this thing. -and how are games running on this thing? And how does it all make it so simple for xdg support?
Its not on Valve that YOUR installing THEIR software on YOUR system...? whats the sense in this argument? And how would even xdg support change that fact? It would probably still be in your home dir. Try hardlinking a file left and right in your home dir. Its probably a matter of something else than a dir. Lets filip it: whats the gain being worth the cost? You not seeing 3-4 files in your home is not exactly worth the cost of even a single game bricking on a engine due to some hard code. |
Probably best to not engage with a fresh account who has no other activity than calling people in this thread "mental". |
Thank you for pointing that out. Got quite carried away and my intention was mostly to see if someone was able to make some argument for how it make sense other than it being nice and worth bricking even a single game. You could also disable "show hidden files and folders" in gui and simply ls without hidden files. Your not treating this as hidden files or dirs at all. Its hardly a spec thats adopted and most apps dont support it. If the argument is that a spec should be followed simply because some minority want that, everyone can make the same argument for any spec? Or is it only XDG base dir spec that is allowed that argument? Its Linux, no one agrees on anything and a spec from freedesktop even less. Uniformity is hardly to be expected. I cant see anyone with a single argument for why its worth the cost involved with bricking games. These claiming its only a matter of env vars arent helping their case. Point being, it would probably be better if there were some arguments other than some few wanting a neat home. -and you dont care if it bricks games or costs. No wonder its not implemented and it absolutely shouldnt unless someone can make the case. Anywho, cheers. my apologies. |
Wanted to add a +1 of sorts to this one myself. I am also a ~/ purist and I'm losing my mind with the three steam entries in my sacred folder. With many programs, I modify my .desktop entry with the HOME environment variable to a neat directory like ~/.local/application/ and it's a bit hacky, but everything works just fine like this and I am sated. However, the nature of Steam being a manager for many applications, and all of which have their own .desktop entries, the above solution loses its merit. So I beg, please consider implementing this QOL update. 🙏 |
Will probably fall on deaf ears but here's my +1 . Surely not that hard to implement. This is why FOSS is always > |
Been cleaning my system and am stuck myself at this "clutter" +1 for adding support. |
This is great, you can also modify it to launch steam-screensaver-fix-runtime instead of steam as that also fixes another issue that steam has disables the screenlock even when no game is running. I edited my i3 keybind to launch it like this:
Edit: I changed the end of the script so that it cleans the homedir if steam creates the directories again like if you had launched it from the terminal, the sleep 8 is needed because it takes a while for steam to quit:
|
At this point, this shits gonna be implemented after GTA VI... XD (Which is never... Like Hollow Knight Silksong) |
Oh wow, Would you look at the Dates? |
This comment was marked as abuse.
This comment was marked as abuse.
bruh... |
anyone wanna start counting bumps? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Please, stop commenting on this thread unless you have something actually new to add to the discussion. At least 84 people get notifications every time someone comments on this thread. And don't feed the trolls. |
Let's run through the files that Steam creates within
The ideal thing to do, if Steam really needs to continue making use of these files as they are, would be the following:
|
I'm gonna be honest though... If Valve is keeping Depending on how they architected their software (hardcoded |
I agree with @Eclextic. And I also believe that it would be wrong to implement this, since it could potentially break any number of games for little to no benefit for the average user. I'd go as far as to say this should be closed as "won't fix". But, for those of us who care about it and are willing to troubleshoot a few broken games, here's the most recent version of my wrapper script (maybe I should create a repo or a gist for it?): #!/usr/bin/env bash
# Where will steam store its files?
export fakeHome=$XDG_DATA_HOME/Steam/fakehome
# The location of steam's real binary
steampath=/usr/bin/steam
# Symlink a file to the fake home
link_dir() {
# Replace HOME with FAKEHOME in the link name
link_name=$(echo $1 | sed "s|^$HOME|$fakeHome|")
# Creates the link's parent directory and symlinks it
mkdir -p $(dirname "$link_name")
if [ ! -d "$link_name" ]; then
ln -s "$1" "$link_name"
fi
}
mkdir -p $fakeHome
# Remove every link in the fake home
find $fakeHome -maxdepth 1 -type l -delete
# If .steam exists in ~/, move it to the fake home, updating the newer files
if [ -d $HOME/.steam ]; then
mv -uf $HOME/.steam/* $fakeHome/.steam/
rmdir $HOME/.steam
fi
# Remove runtime steam files from the user's home
rm -f $HOME/.steampath $HOME/.steampid
# Export the function so we can use it in a new bash context
export -f link_dir
# Link every file in the root of the home directory to the fake home
find $HOME -maxdepth 1 | xargs --max-procs=$(nproc) -I{} bash -c 'link_dir "$0"' {}
HOME=$fakeHome exec $steampath $@ |
I now use a better solution that is more permanent, won't get overwritten by updates, etc the xdg base dir spec says that user binaries should go in
And now place a script named
It will first try to use steam-screensaver-fix if you have it installed, if not it will just launch the regular steam. And if neither is found it will notify of that error. By placing that script first in PATH, steam will always launch at the fakehome location, you can just go to your terminal and type steam and it will launch as always. make sure to also place a symlink in that same dir named steam-runtime pointing to the steam script. Now the desktop entry of Steam in /usr/share/applications it set to run To fix that issue you can just copy the desktop entry of steam from /usr/share/applications to your XDG_DATA_HOME/applications dir and edit the launch option to just say That way steam will always be launched at the fakehome location, and the user desktop entries will overwrite the ones in usr from showing. That is it, we didn't even need to use sudo to fix this issue. Make sure that the fake home of steam has the necessary symlinks to all the directories that steam needs access to, you can also add that function to the script if want to. EDIT: I ended up making a script that fixes this automatically (you still need to make sure https://github.com/Samueru-sama/fixsteam It also applies the screensaver-fix on its own without depending on the aur package to be installed. |
The above fix does not work on FreeBSD using the Steam port. Welcome back gentlemen, I hope to see you again in 2034 🫡 |
If you want open an issue detailing what doesn't work and I will see what I can do. |
This will likely never happen as there are probably things that depend on those dotfiles existing. |
edit: ok, i admit, i didn't yet test before i wrote. editx2:
What's left is |
These days I just run steam in bubblewrap (like flatpak does) and just give it a fake home directory to live in. This has the added benefit that some games that run natively but pick hardcoded locations still (i.e. #!/bin/bash
set -euxo pipefail
args=(
--die-with-parent
--dev-bind /dev /dev
--proc /proc
--bind /run /run
--bind /sys /sys
--tmpfs /tmp
--bind "${HOME}"/my-fake-home-dir "${HOME}" # !!!!!!!! <- CHANGE THIS
--chdir "${HOME}"
# customisations on these don't need to go into your steam bwrap
# it will more likely break things than do anything positive
--unsetenv XDG_CACHE_HOME
--unsetenv XDG_CONFIG_HOME
--unsetenv XDG_DATA_HOME
--unsetenv XDG_STATE_HOME
# https://github.com/flatpak/flatpak/blob/be2de97e862e5ca223da40a895e54e7bf24dbfb9/common/flatpak-run.c#L277
--tmpfs /tmp/.X11-unix
)
install -m 1777 -d /tmp/dumps
args+=(--bind-try /tmp/dumps /tmp/dumps)
for dir in /bin /etc /lib /lib64 /sbin /usr /var; do
args+=(--ro-bind "${dir}" "${dir}")
done
if [[ "${DISPLAY}" == *:* ]]; then
display_nr="${DISPLAY/#*:}" # strip host
display_nr="${display_nr/%.*}" # strip screen
local_socket=/tmp/.X11-unix/X"${display_nr}"
args+=(--ro-bind-try "${local_socket}" "${local_socket}")
fi
if [[ "${XAUTHORITY:-}" == /tmp/* ]]; then
args+=(--ro-bind-try "${XAUTHORITY}" "${XAUTHORITY}")
fi
exec bwrap "${args[@]}" -- /usr/bin/steam -disable-cef-sandbox "$@" Make sure to substitute your own paths in before running, of course, and then drop this as NixOSI based a good part of this script off of NixOS's pkgs.steam.override {
extraBwrapArgs = [
"--bind $HOME/my-fake-home-dir $HOME"
"--unsetenv XDG_CACHE_HOME"
"--unsetenv XDG_CONFIG_HOME"
"--unsetenv XDG_DATA_HOME"
"--unsetenv XDG_STATE_HOME"
];
} You can also pass in this custom steam package to other packages that take a GNU Guix SystemIf you're using Steam from the nonguix repo it already has sandboxing by default. |
From a post on steam forums just linking it here.
Over in our group chat this has come up a few times already.
From a user who already has > 150 dot-files/directories in his home directory: Please, not another one! Since many years, there has been a standard for configuration/data/cache storage. Please follow it.
Simplest implementation (pseudo-code):
if (set(XDG_DATA_HOME))
dir=$XDG_DATA_HOME/Valve/Steam
else
dir=$HOME/.local/share/Valve/Steam
end if
Store everything that is now in $HOME/.steam into that directory.
If you want to get fancy, try to implement the whole specification and split Steam's data between XDG_CONFIG_HOME ($HOME/.config per default), XDG_DATA_HOME and XDG_CACHE_HOME ($HOME/.cache per default).
http://steamcommunity.com/app/221410/discussions/0/882965239742479108/
Original post.
The text was updated successfully, but these errors were encountered: