Add isWildcard() helper to treat both empty string and "*" as wildcards
when matching wallpaper settings to monitors.
This works around a limitation in hyprlang where listKeysForSpecialCategory()
skips entries with empty string keys (due to isStatic check in retrieveKeysForCat),
causing configs like:
wallpaper {
monitor =
path = /path/to/image.png
}
to be silently ignored. Users should now use "monitor = *" instead.
* feat(config): re-add source= include directive support
Re-implements the source= directive for including external config files,
which was originally added in PR #267 for v0.7.6 but lost during the
v0.8.0 hyprtoolkit rewrite.
Features:
- Include external config files using source=/path/to/file.conf
- Glob pattern support (e.g., source=~/.config/hypr/hyprpaper.d/*.conf)
- Tilde expansion for home directory paths
- Relative paths resolved relative to the current config file
- Proper error handling and logging for missing/invalid files
This restores parity with Hyprland's source= behavior, enabling modular
configuration management that was lost in the v0.8.0 transition.
Fixes: hyprwm/hyprpaper#302
* feat(config): add debug logging for source= directive
Adds LOG_DEBUG calls to help troubleshoot config include issues:
- Log when source= directive is encountered with resolved path
- Log number of files matched by glob patterns
- Log each file before parsing
* refactor(config): address PR review feedback & rebase against main
- Use Hyprutils::String::trim() instead of manual whitespace trimming
- Use Hyprutils::Utils::CScopeGuard for glob cleanup instead of manual
globfree() calls
- Remove braces from short single-line if statements per style guide
- Remove duplicate absolutePath(), extend getPath() with optional
basePath parameter instead
For source= directives, relative paths need to resolve relative to the
config file's directory, not CWD. So `source = ./themes/dark.conf` in
`~/.config/hypr/hyprpaper.conf` resolves to
`~/.config/hypr/themes/dark.conf`, not `$CWD/themes/dark.conf`.
* fix(config): address PR review feedback
- Use std::error_code for filesystem calls to avoid exceptions
- Move getCurrentConfigPath() body from header to cpp file
- Apply clang-format
- 'path' can contain multiple images comma separated (including
directories)
- 'timeout' is used to define how long the wallpaper should be shown
in seconds.
Default: 30s
Use nixbuild/nix-quick-install-action which pairs well with
nix-community/cache-nix-action.
Should help with build times by reducing the number of packages needing
to be re-downloaded on each run.
Parameters are taken from https://github.com/nix-community/cache-nix-action
and may be tweaked later.