Theme switch hangs in omarchy-theme-set-browser when Brave Origin runs and brave-bin is installed
System details
AMD Ryzen 5 5600X, AMD Radeon RX 6700 XT, Omarchy 4.0.6-1 (Hyprland 0.56.2), brave-bin 1:1.98.60-1, brave-origin-bin 1:1.98.60-1
What's wrong?
When Brave Origin (brave-origin-bin) is running and regular Brave (brave-bin) is installed but not running, omarchy theme set and omarchy theme refresh never finish. They block in omarchy-theme-set-browser, so the steps after it in omarchy-theme-set never run: omarchy-theme-set-vscode, omarchy-theme-set-obsidian, omarchy-theme-set-keyboard, the theme-set hook, the switcher preload, and the background cache.
Cause
Brave Origin's main binary is /opt/brave-origin-bin/brave, so its process name is brave. In 4.0.6, refresh_running_browser brave brave runs pgrep -x brave, which matches Brave Origin. It then runs brave --refresh-platform-policy --no-startup-window. /usr/bin/brave belongs to brave-bin, which is not running, so this call starts a new Brave instance with no window. That instance does not exit, and the call blocks the script.
The comment above the Brave Origin line already says that its running process "is named plain 'brave'", but the plain brave check has no guard for that case.
The current quattro branch has the same problem. brave:brave matches running_names[brave] from Brave Origin, and wait "$pid" then waits for a refresh process that does not exit.
Steps to reproduce
- Install
brave-binandbrave-origin-bin. - Start Brave Origin only.
- Run
omarchy theme set <theme>with a theme whose browser color is different from the current one. (Onquattro, the policy fast path skips the refresh when the color does not change.) - The command does not return. The child of
omarchy-theme-set-browseris/opt/brave-bin/brave ... --refresh-platform-policy --no-startup-window, with no windows. When this process is stopped, the theme switch finishes.
Evidence (4.0.6-1)
$ for p in $(pgrep -x brave); do readlink -f /proc/$p/exe; done | sort | uniq -c
14 /opt/brave-origin-bin/brave
$ readlink -f "$(command -v brave)"
/usr/bin/brave
$ pacman -Qo /usr/bin/brave
/usr/bin/brave is owned by brave-bin 1:1.98.60-1
The stuck process ran for more than 3 minutes with no window, until I stopped it with kill -TERM.
Possible fix
Match regular Brave on its binary path, as the Brave Origin check does, for example [[ $running_args == *"/opt/brave-bin/"* ]] for brave. Alternatively, do not count the plain brave name when it comes from /opt/brave-origin-bin/. A timeout around each refresh call would also prevent one browser from blocking the whole theme switch.
Confirmed still reproducible on Omarchy 4.5.0-3 with brave-bin 1:1.98.63-1 and brave-origin-bin 1:1.98.63-1 (Intel i5-1135G7 / Iris Xe).
The current implementation has a further user-visible consequence: browser retint runs inside the serialized retint batch, before the user theme-set hooks. A stuck browser refresh therefore prevents all custom theme hooks from running, even though the wallpaper and desktop palette have already changed. In this case Spotify/Surfingkeys output stayed stale and the theme-change notification never ran.
Observed process chain (over 43 minutes):
omarchy-theme-set catppuccin-dark (PID 35999; holds omarchy-theme-set-retint.lock)
omarchy-theme-set-browser (PID 36012)
/opt/brave-bin/brave ... --refresh-platform-policy --no-startup-window (PID 36193)
Nine subsequent theme-set batches were blocked in flock 8 on the same retint lock. The browser refresh was not awaiting privilege authorization; the child was the long-lived standard Brave process. Brave Origin was also running from /opt/brave-origin-bin/brave.
The current quattro browser setter still includes brave:brave in the comm-based matching loop and waits without a timeout for refresh child processes. This matches the cause described above.
Recovery was possible by terminating only the stale theme-set / browser-set shell jobs and their flock helpers, leaving the browsers running. A user-local guard distinguishing standard Brave by /proc/PID/exe and bounding policy-refresh invocations then allowed full theme changes to finish. Two full switches (Nord and back to Catppuccin Dark) exited 0 in 7.76s and 3.18s respectively; each published the correct Surfingkeys palette and sent the custom notification, verified on D-Bus. No retint lock remained held.
Please consider both executable-specific Brave detection and a bounded wait for refresh children so an unexpected browser lifetime cannot starve later retints and user hooks.
I checked the report, the follow-up, the current quattro browser setter, and the earlier report #8158 about the Brave/Brave Origin process-name collision.
GPT-6 in Codex (effort setting unavailable) assessed this as a bug. The required second classifier, deepseek-v4p1-flash, returned no classification, so classification remains unsettled. No worker tests ran. This issue remains open pending classification review; the comparison with #8158 has not resulted in a duplicate closure.
Still reproduces on edge quattro @ ff6533e (installed r7841, omarchy-theme-set-browser unchanged since). One effect the report doesn't mention: the hung wait holds omarchy-theme-set-retint.lock, so every later omarchy-theme-set blocks in flock 8 and omarchy-hook theme-set never runs. All user theme-set.d hooks and the Slack/VS Code/Obsidian retints stop until the orphaned windowless brave is killed. Here it went 7 days and 3 theme switches before I noticed. #16415 or #14658 would fix the cause; #9423's timeout would at least stop the stall from spreading.