Misterio77 / flavours

🎨💧 An easy to use base16 scheme manager that integrates with any workflow.
MIT License
501 stars 29 forks source link

Specify configuration directory through an environment variable #75

Open awanwar opened 1 year ago

awanwar commented 1 year ago

I'm trying to set up a custom scheme on macOS, and I want to place the theme file where my other config files are, in $XDG_CONFIG_HOME. The directory for custom themes and templates are placed at preference_dir() from Rust, which on macOS does not correspond to where I want the directory to be. I'd like to request the ability to change this through an environment variable such as $FLAVOURS_CONFIG_DIRECTORY or $FLAVOURS_CUSTOM_DIRECTORY.

This would involve changing lines 40-42 in main.rs to change flavours_config_dir to be set through an environment variable.

awanwar commented 1 year ago

I also noticed the custom scheme doesn't get discovered if it's hidden behind a symlinked folder. That might need its own issue though.

tiesebarrell commented 1 year ago

I noticed the same issue when attempting to re-use a custom template on MacOS after I set it up in my dotfiles for Linux. The preferences directory is read from a standard MacOS location that's not configurable with an environment variable, which works great for FLAVOURS_CONFIG_FILE and FLAVOURS_DATA_DIRECTORY. It would be a great addition if there was a FLAVOURS_CONFIG_DIRECTORY that was supported.

tiesebarrell commented 1 year ago

I just tested symlinking from the Preferences folder to the .config directory, which does work for me. I performed ln -s ~/.config/flavours /Users/<username>/Library/Preferences/flavours

Misterio77 commented 1 year ago

I also noticed the custom scheme doesn't get discovered if it's hidden behind a symlinked folder. That might need its own issue though.

Please do open an issue! I'll fix it ASAP.