You are not logged in.

#1 2020-04-21 06:09:33

gforsi
Member
Registered: 2020-04-21
Posts: 3

[SOLVED] Redirect application specific folders in $HOME to custom fld.

Hello,

this is my first thread. I am not new to Linux but still consider myself a true newbie. Also, I am sure this question has been asked before, but I was unable to find it.

Question: Many applications create their folders and files in random locations inside the $HOME folder, e.g. snap creates its snap folder, npm creates node_modules, go language creates a go folder etc.
Is there a general way to move those folders to a different location or just hide them via prefix . and let the application that looks for that particular folder redirect to the new location/hidden location?

I know the XDG USER DIRS, but these only work for the common user dirs like Downloads, Documents etc., correct?

I would like to have my $HOME folder clean like a true nerd.

Last edited by gforsi (2020-04-24 04:19:06)

Offline

#2 2020-04-21 06:12:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Redirect application specific folders in $HOME to custom fld.

It depends. Some applications use XDG_CONFIG_HOME. Other allow you to move the files to a directory of your choosing and point the application at them with an environment variable, or with a flag that sources an alternate location (--config=/path/to/dir, for example).

If your application does not afford either of these approaches, you are either going to hack the source, or just grin and bear it.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-04-21 11:12:20

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Redirect application specific folders in $HOME to custom fld.


Jin, Jîyan, Azadî

Offline

#4 2020-04-21 15:34:24

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] Redirect application specific folders in $HOME to custom fld.

The specification these programs are supposed to follow, but often don't: https://wiki.archlinux.org/index.php/XDG_Base_Directory

The second half of this wiki article collects reports of programs which do or don't support the specification, including a table for "partial support" where you might have to start the program with specific options or env vars for it to work.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2020-04-24 04:18:28

gforsi
Member
Registered: 2020-04-21
Posts: 3

Re: [SOLVED] Redirect application specific folders in $HOME to custom fld.

Thanks, it is a shame that such a little amount of programs follow the guidlines for XDG Base Directory.

Offline

Board footer

Powered by FluxBB