🤔 Stop Polluting my $HOME

Once upon a time, I used fish shell. It’s great. It does a lot of what you have to glue onto bash and zsh right out of the box. It also seems to have more sensible defaults and is a bit faster than the other two when kitted out.

That being said, I can’t stand trying to use it on anything other than Linux. Because while it respects the XDG Base Directory Specification, it forces it on every other platform. So, on macOS, you get this ugly, likely empty except for Fish, .config folder as well as matching .cache and .local, which, if you’re fastudious like me, irritates the shit out of you. In fact, I’ve gone to great lengths to make sure that these paths are moved out of the way in to ~/Library/Application Support/org.degruchy.<role> so that they can still be used, but not polluting the root directory.

Fish don’t give a shit. Fish is going to drop all that shit into the root of your $HOME and fuck you for trying to make it work some other way. I go out of my way to setup my .zprofile or .profile to make sure that other applications behave:

# Local bin
if [[ -d "$HOME/Applications/Terminal/bin" ]];
then
	PATH="$PATH:$HOME/Applications/Terminal/bin"
fi

# XDG Compatibility
export XDG_CONFIG_HOME="$HOME/Library/Application Support/org.degruchy.config"
export XDG_DATA_HOME="$HOME/Library/Application Support/org.degruchy.data"
export XDG_CACHE_HOME="$HOME/Library/Application Support/org.degruchy.cache"
export XDG_STATE_HOME="$HOME/Library/Application Support/org.degruchy.state"

However, since Fish is a shell, it runs before that and doesn’t have a concept of a .profile.

Sigh. Well, at least there’s zsh.

Respond via email.