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