kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
708 stars 24 forks source link

allow config file in $XDG_CONFIG_HOME/felix/config.yaml on macOS #210

Closed jaschenb closed 1 year ago

jaschenb commented 1 year ago

Hey!

I organise all my config files in the $XDG_CONFIG_HOME directory even on macOS and I wanted to ask if you would be okay to add the feature that on macOS felix also looks for a config file in $XDG_CONFIG_HOME/felix/config.yaml I saw that you use the general dirs function to get the config path, but would it be okay, to add a check if there is a config file in $XDG_CONFIG_HOME/felix and then load that if it exists?

kyoheiu commented 1 year ago

I think it's possible, and yeah, that would be useful! I'll work on this.

kyoheiu commented 1 year ago

Just to be clear: You mean /Users/$USER/.config by saying $XDG_CONFIG_HOME, right?

jaschenb commented 1 year ago

yes. For me that would be enough. However if you already change this I guess you can think about checking if someone set the $XDG_CONFIG_HOME environment variable and use that and if not then fall back to /Users/$USER/.config. I could imagine, that at some point someone might also want that added.

kyoheiu commented 1 year ago

Hm.. It seems I have to do some research about this. Ultimately you can create a symlink to the config file path and store it wherever you want though.

kyoheiu commented 1 year ago

Implemented on develop branch (I don't test it on my own mac yet).

//On macOS, felix looks for 2 paths:
//First `$HOME/Library/Application Support/felix/config.yaml`,
//and if it fails,
//`$HOME/.config/felix/config.yaml`.

If you're interested, feel free to install from develop and tinker with it! Note that some other behaviors are also changed: e.g. felix no more creates config file even if it's not found: It just launches with the default configuration, without creating new one.

kyoheiu commented 1 year ago

Merged & released in v2.3.0.

jaschenb commented 1 year ago

Sorry that I didn't responst, but I was away. Thanks for implementing this