-
-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add recursive config includes #995
Conversation
Hey, just wanted to ask whether there is interest in this PR. It would substantially simplify maintenance of my dotfiles.
I've added a workaround so it's not completely broken by circular imports. It simply errors out and prints a message at a depth of 101 imports. Thanks! |
Sorry for the delay, it's a nice addition! |
Great, thanks! Will do. |
If waybar can support e.g.
For example, in sway one can have in their main config file: To be honest, polybar's method is vastly preferred: a config that contains everything (multiple bars configured) and then you simply pass an argument specifying which bar you want. It also supports environment variables so you can e.g. |
I'm sure you already considered this, but it would be more intuitive and useful to have duplicate options prioritize the deepest included file over the main config file. This is how it works for most if not all programs that involve hierarchical/recursive overriding of options. The main config file serves as a general template to be overridden by more specialized configs. It is a little bizarre to need to omit options in the main config file for such a purpose, resulting in the user needing to define options for all include files involved (assuming each include file contains host-specific settings). To me, the purpose of an include file is to reduce the amount of duplicate option definitions and make the distinction clear how each include file is different from the general settings but with options in the main config overriding those in the include files, it doesn't seem to achieve either. |
Hey,
so I've tried my hand at implementing recursive configuration imports with an "include" array:
Disclaimer: I have next to no experience in C++ so I very possibly could've built an error into this. I would welcome it very much if you would be able to have a close look at it.
Some things:
If you have comments or would like changes I'd be happy to work on it some more. In that case I would highly appreciate if you could point me into the right direction since I'll probably need to learn about C++ behaviour.
Thanks!