Skip to content
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

Allow using wildcards in config include paths #3862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emar10
Copy link

@emar10 emar10 commented Jan 3, 2025

Since Waybar supports including additional configuration files using the "include" key, I expected to be able to use wildcards in the paths passed in. For example, a drop-in config directory:

{
  "include": "/etc/waybar/config.d/*.jsonc"
}

Currently, this almost works. Config::tryExpandPath() already expands wildcards using wordexp(), but only takes the first result and discards the rest.

This PR updates Config::tryExpandPath() to return a vector of expanded path matches instead of a single path wrapped in an optional, with an empty vector indicating no matches.

Config::resolveConfigIncludes() iterates over all of these matches, while other instances of path expansion (such as finding the base config path) retain their existing behavior and only use the first match.

Updates `Config::tryExpandPath()` to return a vector of expanded path
matches instead of a single path wrapped in an optional, with an empty
vector indicating no matches.

`Config::resolveConfigIncludes()` iterates over all of these matches,
while other instances of path expansion (such as finding the base config
path) retain their existing behavior and only use the first match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant