Relative paths in included configs #4333
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a two part PR, it appears when I was tinkering with my
waybar
config in my ``~/.config/waybar/` directory and occasionally didand suddenly half of my waybar just disappeared. It took me a long time to trace the issue, since there was zero messages in logs, even with
-l debug
key.So, as a result here is the PR:
I've added couple of warning statements that elements description is missing. My assumption is that unlike any other elements (e.g. "cpu"), "custom" and "group" elements has no defaults to fall into, so if there is no configuration found (it can be wrong include as in my case, or just a typo) then this element will always be hidden. And so it is legit to warn user that this may happen.
I've added config search for include files in the same manner as regular
config
search. The only difference, I do not want for existing configs to be broken, so it is slightly more complex than just callfindConfigPath
. In this implementation if user uses absolute paths they work as usual, and this change only kicks in if user uses relative paths (which I presume mostly case of newcomers).I've tried it in my environment and it is working as expected.
Also, I am flexible, can split this PR in two if needed or do modifications if some parts of this set up are unacceptable.