Repository navigation
Stop re-sampling the wallpaper for the transparent bar on unrelated state writes (4.5) - #16799
Merged
Merged
Conversation
…tate writes (#8307) * Stop re-sampling the wallpaper for the transparent bar on unrelated state writes The bar watched ~/.local/state/omarchy/current for background changes. A directory path never sits in QFileSystemWatcher's file set, so Quickshell's FileView re-emitted fileChanged for every entry created, renamed or removed in ~/.local/state/omarchy as well. Any plugin writing there atomically (tmp + rename) re-ran omarchy-bar-text-color, and on a 5K display that ImageMagick pass cost ~2.6 core-seconds across every thread. One plugin saving every 10 s held ~40% of a core for the whole session, invisible in quickshell's own CPU figure because magick is a reaped grandchild. Watching the symlink directly does not work: inotify follows it to the old image and ln -nsf never touches that inode. Keep the directory watch, resolve the link with readlink -f and only refresh when the wallpaper actually moved. Sample at a reduced scale in omarchy-bar-text-color too. The strip is averaged to one pixel, so shrink the geometry by an integer factor (never upscale) and let the JPEG decoder skip the detail: 2.58 -> 0.065 core-seconds per sample on a 2912x1632 JPEG at 5120x2160, same result. * Resolve the background link at startup and cover the watcher in the runtime smoke test FileView reports no change for its initial load, so without a baseline the first unrelated write in the state directory still compared against "" and sampled once. Run the probe when the bar starts. The smoke test now stubs omarchy-bar-text-color and counts calls in the running shell: turning transparency on samples once, an atomic write of an unrelated file in ~/.local/state/omarchy does not sample again, and repointing current/background does. Against the previous Bar.qml the unrelated write registers as a second sample and the test fails. * Drop the reduced-scale helper tests, which #14281 covers The merge took quattro's omarchy-bar-text-color, whose 1920px canvas, JPEG size hint and resource caps from #14281 already bound the sample this branch shrank, so its tests for the old downscale go with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Watch inside current/ so unrelated state writes do not re-sample the bar FileView watches its path's parent directory too, and re-emits fileChanged for every entry created, renamed or removed there whenever the path itself is not a watched file. Watching ~/.local/state/omarchy/current made that parent ~/.local/state/omarchy, which plugins write to constantly, so the transparent bar re-ran ImageMagick on every unrelated save. Watching current/theme moves the parent to current/, where omarchy-theme-set swaps the theme and omarchy-theme-bg-set repoints the background link, and both still arrive. This replaces a readlink probe that resolved the link on every event: no extra process, and a theme switch that lands on a same-named background still re-samples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> --------- Co-authored-by: Omarchybot <317366263+omarchybot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Omarchybot <omabot@omarchy.org> Co-authored-by: Codex Medium <noreply@openai.com> (cherry picked from commit bc220e7)
Contributor
[Low impact] This PR appears safe to merge. SummaryMoves the transparent bar’s wallpaper watch from
Reviews (1) · Last reviewed commit: "Stop re-sampling the wallpaper for the t..." · Reviewed by Greptile |
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.
Backports #8307 to 4.5. It merged to
quattroafterv4-5-0was cut. With a transparent bar, 4.5 re-runs the wallpaper sample on every write any plugin makes under~/.local/state/omarchy, because the bar's watch oncurrentalso fires for its parent directory. This moves the watch tocurrent/theme, so only a theme or background swap re-samples. Clean cherry-pick of its squash commit, on top of the #14281 backport already in 4.5.🤖 Generated by Opus 5.5 in Claude Code.