2

I have many installed games, from various sources/stores/frontends (Steam, GOG, Humble Store and Lutris with modules like DOSBox, Libretro, WINE and ScummVM).

Unfortunately many game developers elect their own path under the user home folder to keep game related files (saves, configs, etc). There is clearly no standard or consensus in this aspect of linux gaming.

Most of those paths are under a few standard subfolders like:

/home/user/Documents/HardWest
/home/user/.config/BossConstructor
/home/user/.local/Uber Entertainment/Planetary Annihilation
/home/user/.local/share/Aspyr/Sid Meier's Civilization 5

But some create their own hidden folder put directly into the user home folder like:

/home/user/.BADLAND
/home/user/.frictionalgames/Amnesia
/home/user/.prefs

And some create visible folders there like (7 visible ones now and counting, those are the worst ofenders):

/home/user/LoversInADangerousSpacetime
/home/user/Larian Studios/Divinity Original Sin Enhanced Edition
/home/user/My Games/Orwell

And even some that use multiple paths like:

/home/user/Nongunz
/home/user/.config/nongunz

This is starting to get too messy, so I want to move them into a "games" subfolder or such, and keep my home folder clean.

I have searched online for a way to transparently redirect the game into using a new path to store their files, but all I get is mounting or symlinking. Since the idea is to eliminate those folders, not just link them, that doesn't solve the issue.

Changing the working folder doesn't seem to work either, but I might be missing something here...

Passing a parameter or setting an environment variable to each game/frontend is an acceptable solution, but I would prefer something I can set globally like a from-to table of paths. I have admin rights to the machine in question.

Is there something available (gui, cli or config) on Ubuntu, bash, linux kernel, ...?

PS: If it works well intend to somehow link the answers as a feature request/code contribution to https://github.com/supremesonicbrazil/SLSK

3 Answers3

1

If your problem is only with the visible folders in your home directory, you can simply hide them in file manager without changing their names. For that you need to create a file called .hidden in your home directory and write the names of the folders you want to hide in the .hidden file.

In your case content of the ~/.hidden file may be the following.

LoversInADangerousSpacetime
Larian Studios
My Games

and so.

pomsky
  • 70,557
1

Sorry for the thread necromancy, but I found this topic trough the Steam namespace support announcement. And I have an idea so stupid that it might actually work:

  • create a separate user, that would be used only for launching games, disable password login,
  • set sudo to launch any command with that user without a password*,
  • [optionally] adjust .desktop files to use the sudo invocation,
  • [optionally] alias commands, as above, if using the CLI.

Also there should be a blacklist of developers not abiding the XDG specifications.

* would need a moment to prepare an working example.

0

I sadly don't think what you want is possible. It's the responsibility of each single application/game's developers to specify their saving locations.

If they decide to hard-code a specific folder into the application, there's no way for you to change it. (Well, if the game is open source, you could change it there and recompile it, or file an issue/feature request for the developer and wait for reactions...)

If they built in some configuration option, let it be e.g. an environment variable, a command-line argument or some in-application setting, that is then specific to this single application and you'd have to figure it out and adapt it for each manually.

Byte Commander
  • 110,243