Added "source=" capability to Hyprpaper .conf file - #267
Merged
Conversation
Contributor
Author
vaxerski
reviewed
Jul 27, 2025
vaxerski
left a comment
Member
There was a problem hiding this comment.
clang-format needed rest lgtm
…ears ready to go. :)
Contributor
Author
|
Thank you greatly for the review & introduction of clang-format. :) |
vaxerski
approved these changes
Jul 27, 2025
jmylchreest
added a commit
to jmylchreest/hyprpaper
that referenced
this pull request
Dec 31, 2025
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
jmylchreest
added a commit
to jmylchreest/hyprpaper
that referenced
this pull request
Jan 2, 2026
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
vaxerski
pushed a commit
that referenced
this pull request
Jan 2, 2026
* 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: #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
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
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.

Hi, short answer: I'm creating a Wallpaper Manager in Rust (rs-paper name pending*) and as part of my logic for saving wallpaper "sets", I need to be able to quickly adjust per-display wallpapers without altering other monitors. I've come up with the solution of having .conf files for each display (auto-created by parsing hyprctl -j monitor results) and my app will take a selected wallpaper and update the specific .conf file to that wallpaper.
Using $variables, I can have a file be DP-1.conf and echo into it $DP-1 = path/to/image.png
Now my hyprpaper.conf can read:
preload = $DP-1
wallpaper = DP-1, $DP-1
I never adjust hyprpaper.conf outside of initial setup (which runs on start-up for simplicity) and my logic only targets per-monitor .conf files instead of re-writing the entire hypaper.conf
That said . . . source= was not implemented in hyprpaper like it is in Hyprland. This functionality is crucial for my app design & was very easy to implement (to be clear, I did rely on ChatGPT to assist with this). Hoping you guys could review the pull, feel free to rewrite/adjust the code however, just hoping to see this source= functionality in the main app.
Thank you!