steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

[Feature Request] Follow XDG Base Directory Specification

Open brl1214 opened this issue 12 years ago • 189 comments

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.

brl1214 avatar Feb 19 '13 07:02 brl1214

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.

ghost avatar Feb 20 '13 19:02 ghost

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.

dcbishop avatar May 29 '13 06:05 dcbishop

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

jleclanche avatar Jun 08 '14 15:06 jleclanche

Steam still not properly implementing XDG basespecs. thanks for more shit in my home folder.

brl1214 avatar Sep 08 '14 21:09 brl1214

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.

ghost avatar Nov 19 '14 23:11 ghost

No updates yet? How hard is to follow the XDG basespecs?

pfsmorigo avatar Mar 29 '15 14:03 pfsmorigo

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).

escondida avatar May 22 '16 21:05 escondida

+1

ghost avatar Jun 23 '17 20:06 ghost

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:

#!/usr/bin/env sh
HOME=$HOME/local/data/games/steam_garbage # or wherever
exec /usr/bin/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.

escondida avatar Jun 03 '18 01:06 escondida

this sucks. please fix this, I dont want any of this garbage in my home folder

theKraid avatar Jul 20 '18 08:07 theKraid

The steam Linux client is in dire need of many QOL fixes, this being a big one.

Soapux avatar Aug 24 '18 03:08 Soapux

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. Please fix this, this is extremely low hanging fruit that leaves a bad taste in people's mouths when trying out steam on Linux. I use my laptop running Fedora for work, and it seriously does not help to have my home directory littered with various save files for games simply because you guys didn't take the time to do what literally almost everything else on Linux has been doing for years.

Lyude avatar Apr 04 '19 15:04 Lyude

If these files are needed for older games. Why not just create them when you install the old game? Instead of putting broken symlinks in my home directory.

Jimbolino avatar Jul 12 '19 00:07 Jimbolino

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

shubham-cpp avatar Apr 28 '20 14:04 shubham-cpp

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.

laydros avatar Jun 03 '20 16:06 laydros

come on....... follow specs

felixsanz avatar Jun 08 '20 23:06 felixsanz

It's bad enough when a program create 1 dotfile/directory in $HOME, but three? And two of them are symlinks? Follow specs.

RJSent avatar Jun 12 '20 13:06 RJSent

Yeah, its funny how valve created proton so that almost any windows game runs flawless in linux. But a simple script that creates some symlinks when you start the few old games that require it, is not on their todo list. You could even make it so that when the game launches the symlinks are created, and when you quit te game, the symlinks are removed...

Jimbolino avatar Jun 12 '20 13:06 Jimbolino

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. :(

tiritto avatar Jul 04 '20 03:07 tiritto

I thank Valve for all the effort they put into making things work on Linux.
At least if they cannot follow the spec perfectly I would prefer them not put anything under $HOME, putting everything under $XDG_DATA_HOME/Steam would be a fine start.

itaranto avatar Jul 09 '20 22:07 itaranto

Come on, this is an easy issue to fix. Can't take 7 years to address.

Pablo1107 avatar Sep 20 '20 23:09 Pablo1107

Bump. Joining people above

ZerdoX-x avatar Dec 03 '20 13:12 ZerdoX-x

Bump. I hope Valve will solve this issue sooner.

serhanekicii avatar Dec 20 '20 16:12 serhanekicii

Here's an improved version of @escondida's script:

#!/usr/bin/env sh

OLDHOME=$HOME
HOME=$XDG_DATA_HOME/Steam/fakehome # Replace this with where you want it to be

# Replaces every / of the first argument with \/
replace_slash() {
	echo $1 | sed "s/\//\\\\\//g"
}

# Symlink a file to the fake home
link_dir() {
	# Replace OLDHOME with HOME in the link name
	link_name=$(echo $1 | sed "s/^$(replace_slash $OLDHOME)/$(replace_slash $HOME)/")

	# Creates the link's parent directory and symlinks it
	mkdir -p $(dirname $link_name)
	[ ! -d $link_name ] && ln -s $1 $link_name
}

mkdir -p $HOME

link_dir $XDG_DATA_HOME   # ~/.local/share
link_dir $XDG_CACHE_HOME	 # ~/.cache
link_dir $XDG_CONFIG_HOME # ~/.config
link_dir $OLDHOME/.icons  # ~/.icons (lxappearance's mouse cursor theme)

# If .steam exists in ~/ and not in the fake home, move it to the fake home
[ -d $OLDHOME/.steam ] && [ ! -d $HOME/.steam ] && mv $OLDHOME/.steam $HOME/

exec /usr/bin/steam "$@"

I have only tested it in Arch Linux and with a few games (CS:GO and Factorio at the moment). They both work but factorio still uses ~/.factorio even if you change the launch options inside of steam to point $HOME to somewhere else.

Also, Valve please fix.

mateusauler avatar Feb 11 '21 17:02 mateusauler

Day 2918

Yet another bump, a prayer at this shrine I doubt valve will hear any cries of mine Seven years I count, and eight to come A specification so simple, yet never done

RaafatTurki avatar Feb 15 '21 18:02 RaafatTurki

bump

johannesrld avatar May 02 '21 18:05 johannesrld

This issue was opened in 2013, and yet 8 years (3008 days) down the line it is still an issue.

tiritto avatar May 16 '21 19:05 tiritto

bump

joaquin-rossi avatar Jun 12 '21 17:06 joaquin-rossi

bump. the funniest thing among all this is that ~/.steampath doesn't even point to any valid path. it goes to ~/.steam/sdk32/steam which doesn't exist

LunarLambda avatar Jun 27 '21 12:06 LunarLambda

Bump again.

livmackintosh avatar Jul 04 '21 18:07 livmackintosh