Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

feat: Add XDG Base Directory Specification support #91

Merged
merged 1 commit into from
Jun 4, 2021
Merged

feat: Add XDG Base Directory Specification support #91

merged 1 commit into from
Jun 4, 2021

Conversation

scheatkode
Copy link
Contributor

This enables XDG support as well as a few other places in which the configuration file can be located. These are as follows :

  • ${XDG_CONFIG_HOME} — if available, falling back to ~/.config otherwise.
  • ~/Library/Preferences/chromaterm/chromaterm in MacOS.
  • The default ~/.chromaterm.yml
  • A system-wide /etc/chromaterm/chromaterm.yml

The file extensions can now also be yml as well as yaml.

Forgive my rusty python and feel free to point me towards any change that you might want incorporated.

@scheatkode scheatkode requested a review from hSaria as a code owner June 4, 2021 21:23
@hSaria
Copy link
Owner

hSaria commented Jun 4, 2021

Thanks for the PR. I'll give it a look.

Don't worry about the tests :)

@hSaria
Copy link
Owner

hSaria commented Jun 4, 2021

Looks great and makes sense.

There's a bug with check_config_files and how it works with ct --config some_file.yml; it will ignore the --config value if it matches a file in any of the search paths. I'll get it sorted.

I'll update README.md to indicate the search paths.

Thanks again.

@hSaria hSaria merged commit ed6fbca into hSaria:master Jun 4, 2021
@scheatkode scheatkode deleted the feat/xdg-support branch June 4, 2021 22:27
@scheatkode
Copy link
Contributor Author

You're most definitely right, I forgot to check for args.config before calling the function, my bad. 😅
I have the fix ready, should I open another PR ?

Thank your for your feedback and for your work !

@hSaria
Copy link
Owner

hSaria commented Jun 5, 2021

I pulled the fix. Thanks again!

@hSaria
Copy link
Owner

hSaria commented Jun 5, 2021

I've opted to remove the macOS-specific path. Don't get me wrong, I'm a huge apple fanboy and a mac-user-first (can't wait for WWDC21 in a few days), but I wanna keep ChromaTerm as neutral as possible.

Although .yml and .yaml are both supported, I didn't mention them in README.md; I figured that might be confusing for people only just getting started.

Greatly appreciate your work 👍. v0.7.2 just released.

@scheatkode
Copy link
Contributor Author

I've opted to remove the macOS-specific path. Don't get me wrong, I'm a huge apple fanboy and a mac-user-first (can't wait for WWDC21 in a few days), but I wanna keep ChromaTerm as neutral as possible.

That's indeed legitimate.

Although .yml and .yaml are both supported, I didn't mention them in README.md; I figured that might be confusing for people only just getting started.

Well thought. My experience is that software usually supports both implicitly.

Greatly appreciate your work 👍. v0.7.2 just released.

I just checked your commits and I have to say you did great ! Keep it up ! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants