this repo has no description
1+++
2title = "Stop Spreading Crap at My `$HOME`"
3date = 2020-04-15T12:00:19+02:00
4
5[taxonomies]
6tags = [
7 "programming",
8 "culture"
9]
10+++
11
12**Disclaimer:** Yes, this is a rant. Yes, I am displeased with state of
13software. And yes, I can use some harsh words. You were warned.
14
15For a some time now we have [Filesystem Hierarchy Standard][fhs] which describes
16which data goes where in your \*nix installation. In fact we have that for 28
17years, which is almost as long as I live. This is quite some time. But for
18whatever reason we apply that only for the system hierarchy and we cannot have
19the same for something much closer to our heart - our dear `$HOME`.
20
21Common practice for storing all the stuff for different applications is to use
22dot files stored in `$HOME`. These are files or directories starting with dot in
23their name which makes such files "hidden" on Unix systems. There is problem
24though. First let me show you all the files starting with dot in my `$HOME`:
25
26```
27-r-------- 1 hauleth staff 9 Mar 30 2019 .CFUserTextEncoding
28-rw-r--r-- 1 hauleth staff 16388 Apr 9 11:46 .DS_Store
29drwx------ 2 hauleth staff 64 Apr 13 20:54 .Trash
30-rw------- 1 hauleth staff 17835 Apr 10 21:17 .bash_history
31drwx------ 12 hauleth staff 384 Mar 30 2019 .bash_sessions
32drwxr-xr-x 13 hauleth staff 416 Mar 26 14:02 .cache
33lrwxr-xr-x 1 hauleth staff 40 Aug 21 2019 .chunkwmrc
34drwxr-xr-x 20 hauleth staff 640 Apr 15 21:59 .config
35drwx------ 3 hauleth staff 96 Apr 20 2019 .cups
36lrwxr-xr-x 1 hauleth staff 39 Aug 21 2019 .curlrc
37lrwxr-xr-x 1 hauleth staff 43 Aug 21 2019 .dir_colors
38-rw-r--r-- 1 hauleth staff 2587 Sep 10 2019 .direnvrc
39drwxr-xr-x 6 hauleth staff 192 Apr 14 18:27 .docker
40drwx------ 14 hauleth staff 448 Oct 1 2019 .dropbox
41-r-------- 1 hauleth staff 20 Apr 1 2019 .erlang.cookie
42drwxr-xr-x 3 hauleth staff 96 Jul 1 2019 .gem
43-rw-r--r-- 1 hauleth staff 518 Mar 25 22:44 .gitconfig
44drwx------ 14 hauleth staff 448 Apr 15 22:03 .gnupg
45drwxr-xr-x 4 hauleth staff 128 Apr 2 2019 .hammerspoon
46drwxr-xr-x 5 hauleth staff 160 Apr 14 19:39 .hex
47drwx------ 3 hauleth staff 96 Apr 26 2019 .httpie
48-rw-r--r-- 1 hauleth staff 165 Feb 22 13:50 .jlassetregistry.json
49drwxr-xr-x 3 hauleth staff 96 Nov 29 22:13 .jssc
50drwxr-xr-x 9 hauleth staff 288 Feb 21 17:46 .julia
51drwx------ 14 hauleth staff 448 Oct 2 2019 .keychain
52drwxr-x--- 5 hauleth staff 160 Jan 24 12:20 .kube
53-rw------- 1 hauleth staff 720 Apr 15 16:29 .lesshst
54drwxr-x--- 3 root staff 96 Apr 3 2019 .lldb
55drwx------ 4 hauleth staff 128 Dec 18 14:16 .local
56drwxr-xr-x 8 hauleth staff 256 Mar 20 12:29 .mitmproxy
57drwxr-xr-x 18 hauleth staff 576 Apr 13 14:36 .mix
58-rw-r--r-- 1 hauleth staff 116 Apr 13 20:59 .nix-channels
59drwxr-xr-x 4 hauleth staff 128 Apr 14 13:47 .nix-defexpr
60lrwxr-xr-x 1 hauleth staff 46 Feb 1 22:13 .nix-profile
61drwxr-xr-x 3 hauleth staff 96 Sep 27 2019 .npm
62drwxr-xr-x 3 hauleth staff 96 Dec 19 14:05 .pex
63-rw-r--r-- 1 hauleth staff 183 May 2 2019 .profile
64drwxr-xr-x 5 hauleth staff 160 Mar 20 16:27 .proxyman
65drwxr-xr-x 2 hauleth staff 64 Feb 17 14:09 .proxyman-data
66-rw------- 1 hauleth staff 1391 Jan 22 11:46 .psql_history
67-rw------- 1 hauleth staff 1950 Feb 19 12:42 .python_history
68lrwxr-xr-x 1 hauleth staff 37 Aug 21 2019 .skhdrc
69drwx------ 11 hauleth staff 352 Oct 2 2019 .ssh
70drwxr-xr-x 4 hauleth staff 128 May 8 2019 .terraform.d
71drwxr-xr-x 4 hauleth staff 128 Dec 1 21:52 .thumbnails
72drwxr-xr-x 9 hauleth staff 288 Mar 9 17:14 .vagrant.d
73-rw------- 1 hauleth staff 11124 Apr 13 20:21 .viminfo
74lrwxr-xr-x 1 hauleth staff 37 Aug 21 2019 .vimrc
75drwx------ 4 hauleth staff 128 Nov 8 16:51 .w3m
76drwxr-xr-x 37 hauleth staff 1184 Apr 13 21:21 .weechat
77```
78
79As you can see, there is bunch of them, some are linked to my dotfiles
80repository, but most are not. What is the problem there?
81
82The spread.
83
84All of the data is smeared between gazillion of different filed with different
85types of data. This causes headaches because:
86
87- I cannot easily backup all the configuration as I need to check each file
88 independently to check if this is configuration file or it is data
89- I cannot exclude data from my backups in a uniform way. I need to check each
90 file independently and exclude it, remembering to do that for each new tool
91 that I add. Alternatively I can use whitelist instead of blacklist of paths
92 that I want to backup, but that pretty much defies the idea of having
93 automatic backup.
94- Cleaning up the old caches and data is troublesome as user need to review all
95 the folders and know what data they see mean.
96
97But what We can do? Well, the macOS and Windows got it somewhat right, these
98OSes provide special paths for storing all configuration, caches, user-data,
99etc. in special, dedicated, and well known locations within user directories. It
100is like mentioned earlier FHS but for `$HOME`.
101
102Unfortunately no other OS out there had:
103
1041. Power to force developers to behave reasonably
1052. Standard to which developers should adhere to
106
107Unfortunately the 1st point is still true, but the 2nd one is somewhat resolved
108in form of [XDG Base Directory Specification][xdg]. This is pretty short,
109simple, and straightforward spec where which data should go.
110
111This makes life so much easier:
112
113- Want to have backup your configuration? Just copy `$HOME/.config` where you
114 want.
115- Want to reset your configuration to base one? Just delete `$HOME/.config`.
116- Want to cleanup caches? Remove `$HOME/.cache`.
117- Etc.
118
119It makes your `$HOME` much cleaner, much more manageable, much more like your
120place, where you are the ruler, not as a manager of the bulletin board or the
121storage house.
122
123At one point I was even considering to have approach similar to [one taken by
124Graham Christensen][delete-your-darlings], but that would make my life even more
125miserable instead of forcing developers to fix their software.
126
127Just in case, this is not only mine view on the state of configuration files,
128just see [old Google+ post by Rob Pike][pike] where he states exactly the same
129thing that FreeDesktop team try to address. I may not agree on all the concepts
130with Commander, but this one I vote all-fours.
131
132For these who want to stop that madness and fix at least some software out there
133that is broken, you can check out [my script][xdg-please] that tries to fix
134(at least partially) non-conforming software.
135
136---
137
138**TL;DR**
139
140Please, stop leaving your c\*\*p in my `$HOME` and call it "installation". If
141you want that, then I think you should find nearest Modern Art Gallery.
142
143---
144
145You can comment it on [Lobste.rs](https://lobste.rs/s/va7gic/stop_spreading_c_p_at_my_home)
146[Reddit](https://www.reddit.com/r/programming/comments/g2210g/stop_spreading_cp_at_my_home/)
147or @ me on Twitter.
148
149[fhs]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
150[xdg]: https://specifications.freedesktop.org/basedir-spec/latest/index.html
151[delete-your-darlings]: https://grahamc.com/blog/erase-your-darlings
152[pike]: https://web.archive.org/web/20180827160401/plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp
153[xdg-please]: https://github.com/hauleth/xdg-rlz