smartcd icon indicating copy to clipboard operation
smartcd copied to clipboard

Customize location and respect XDG directories?

Open jcrben opened this issue 8 years ago • 1 comments

Hi, I like to organize all my dotfiles outside of my home directory and split up application data from user configuration. The XDG directories help do that - scripts would probably be under XDG_CONFIG_HOME, while the other application stuff would be under XDG_DATA_HOME and any caches would be under XDG_CACHE_HOME.

It would also be good to allow a user to set a simple environment variable to move the entire directory somewhere else... that's a simpler thing than splitting stuff up. Something like SMARTCD_HOME.

In this case, I used this to get my configuration (scripts) into my dotfiles:

rm -rf .smartcd/scripts
ln -s ~/dotfiles/config/smartcd/scripts ~/.smartcd/scripts

I would prefer to set an environment variable to avoid doing that.

Would you be open to a PR?

jcrben avatar Jan 24 '18 05:01 jcrben

This sounds pretty reasonable. The point with the shadow directory was to avoid unintended interactions with untrusted scripts, and this doesn't impede that goal. I guess my main concern would be if a smartcd script were itself were to change the value of SMARTCD_HOME, then you could run an enter script from one source and an exit script from another. I'm not inclined to prevent people from using that footgun though.

cxreg avatar Jan 25 '18 19:01 cxreg