-
-
Notifications
You must be signed in to change notification settings - Fork 91
feat(config): re-add source= include directive support #303
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
Merged
vaxerski
merged 4 commits into
hyprwm:main
from
jmylchreest:feat/add-source-config-support
Jan 2, 2026
Merged
feat(config): re-add source= include directive support #303
vaxerski
merged 4 commits into
hyprwm:main
from
jmylchreest:feat/add-source-config-support
Jan 2, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vaxerski
reviewed
Jan 1, 2026
Member
|
can you rebase on main |
Re-implements the source= directive for including external config files, which was originally added in PR hyprwm#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#302
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
- 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`.
de3afe7 to
dca6536
Compare
Contributor
Author
|
@vaxerski done. |
vaxerski
reviewed
Jan 2, 2026
Member
vaxerski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs a cf
- Use std::error_code for filesystem calls to avoid exceptions - Move getCurrentConfigPath() body from header to cpp file - Apply clang-format
vaxerski
approved these changes
Jan 2, 2026
Member
vaxerski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
source=directive for including external config filesBackground
The
source=directive was originally added in PR #267 (commit 6502c87) for v0.7.6, but was lost during the v0.8.0 hyprtoolkit rewrite.This PR restores that functionality, enabling users to:
source=~/.config/hypr/hyprpaper.d/wallpapers.conf)source=~/.config/hypr/hyprpaper.d/*.conf)Implementation
The implementation follows the same pattern as the original PR #267 and Hyprland's
source=behavior:sourcedirective inCConfigManager::init()handleSource()function:glob()to expand patternshyprlang->parseFile()for each matched filegetCurrentConfigPath()getter for relative path resolutionTesting
Tested with various configurations:
source=/etc/hyprpaper/themes/dark.confsource=~/hyprpaper-extras.confsource=./colors.confsource=~/.config/hypr/hyprpaper.d/*.confFixes: #302