Repository navigation
Conversation
When OMARCHY_THEME_SKIP_BACKGROUND=1 is set (such as during theme refresh or template regeneration), omarchy-theme-set swaps the staged theme directory in place but skips updating the current background symlink. If the active background was renamed, converted (e.g. .jpg to .webp), or removed upstream, the background symlink is left dangling, causing omarchy-shell to fail rendering the desktop background on subsequent sessions. Check whether CURRENT_BACKGROUND_LINK is missing or dangling before skipping background setup. If broken, fall back to setting an available theme background, matching filename stem when possible to preserve the user's wallpaper selection across extension changes.
quattro now remembers a wallpaper per theme and only looks at the current link when the theme is unchanged, so the stem match and the refresh-keeps-the-same-background rule move inside that branch, which is the only one a refresh takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unquoted, the stem is a glob pattern, so a renamed 1-art[wide].jpg never matched its .webp and a * or ? in a path could match an unrelated file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
Two cases run omarchy-theme-set outside headless mode, which runs every post-theme command for real: kitty and ghostty get signalled and GNOME settings change on whatever desktop runs the suite. Stubbing each command on PATH is not enough, because run_parallel starts them through bash -lc and env-bootstrap puts a dev-linked $OMARCHY_PATH/bin back in front, so a bash shim drops the -lc calls and passes everything else to /bin/bash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed, with three commits pushed to the branch. The bug is real on Pushed
Checked, on a worker built from the Omarchy ISO
Second opinion: Codex Medium reviewed it in two rounds. The first round found both the unquoted stem and the test reaching the real session hooks. The second round, pinned to Still open
Next: this is labelled |
[Medium impact] The PR appears safe to merge, with one non-blocking test coverage gap from the previous review. Findings
SummaryRepairs missing or broken background links when refreshing a theme.
|
| for command in omarchy-shell omarchy-hook omarchy-notification-send omarchy-theme-set-herdr-machines omarchy-theme-bg-cache; do | ||
| printf '#!/bin/bash\nexit 0\n' >"$stub_bin/$command" | ||
| done |
There was a problem hiding this comment.
Shell transition goes untested The non-headless refresh tests check that the repaired symlink points to a file, but this stub always reports success and records no calls. The tests would still pass if the running shell were never told to display the replacement background. Please record and assert the transition call and its target so the visible repair is covered.
Knowledge Base Used: Theme switching and application sync
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
quattro now retints Omarchy's app icons in the headless branch, beside this branch's heal of a dangling background link; both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A refresh of a theme with no backgrounds found the link missing, called set_theme_background, and sent "No background was found for theme" on every update that refreshes the theme. It now heals only when choose_theme_background finds a file, and otherwise applies the palette as before. The headless branch heals a missing link as well as a dangling one, so the two branches agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_parallel now starts each retint straight from PATH rather than through bash -lc, so the bash shim intercepted nothing and the non-headless cases ran the real omarchy-restart-* and omarchy-theme-set-* commands: terminals signalled and Hyprland reloaded on whatever desktop ran the test. Every one of them is stubbed on PATH instead, as theme-set-retint-order-test.sh does, keeping omarchy-theme-set-templates real. The refresh also sets OMARCHY_THEME_WAIT=1, as omarchy-theme-refresh does. Without it the other retints ran detached, and the test's cleanup could remove the stubs before they started, so a late lookup would fall through to the real command in bin/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed again after Pushed
Checked, on a worker built from the Omarchy ISO
Second opinion: Codex Medium and muse-wonder via pi (thinking high) reviewed it in three rounds. They found the test still reaching real restart commands, and the detached retints outliving the test; both are fixed above. Both models agree the merge lost nothing from Still open
Next: this is labelled |
When
OMARCHY_THEME_SKIP_BACKGROUND=1is set (such as duringomarchy theme refresh, template regenerations, or post-update migrations),omarchy-theme-setwipes and swaps the staged theme directory in place but bypasses updating the active background symlink (~/.local/state/omarchy/current/background).If an active theme background file was renamed, converted (e.g.
.jpg->.webpas in commit a4219f8), or removed upstream, the background symlink is left dangling pointing to the non-existent file path. On subsequent boots or lock screen activations,omarchy-shell/Background.qmllogsCannot open: file://...and fails to render the desktop background, leaving a black/empty screen until the user manually re-selects the theme.Solution
OMARCHY_THEME_SKIP_BACKGROUND=1is active, check whetherCURRENT_BACKGROUND_LINKexists and resolves to a valid file ([[ ! -e $CURRENT_BACKGROUND_LINK ]]). If the link is broken or missing, fall back to setting an available theme background instead of leaving a dead link.choose_theme_background, if exact path matching fails, check for a matching filename stem (${background%.*}). This ensures that when upstream converts image formats (e.g.1-cosmic.jpg->1-cosmic.webp), the user's active wallpaper selection is preserved rather than jumping to the default wallpaper.OMARCHY_THEME_SKIP_BACKGROUND=1is set, preserve the matched index rather than advancing tonext_index, honoring the caller's intent not to cycle the wallpaper.THEME_HEADLESS=1), also healCURRENT_BACKGROUND_LINKif it is a dangling symlink.Verification
Added
test/shell.d/theme-refresh-background-test.shcovering:.jpg->.webp) and healing the symlink.All 4 test cases pass:
Existing theme tests (
test/shell.d/theme-staging-test.shandtest/shell.d/video-background-test.sh) continue to pass.