Skip browser policy refresh when browser is not running (#5321)

chromium/brave --refresh-platform-policy blocks forever when the
browser is not already running, hanging omarchy-update entirely.
Guard both calls with pgrep so the policy file is still written
(picked up on next launch) but the blocking refresh is skipped.

Closes #4772
This commit is contained in:
Pete Jackson
2026-04-22 13:26:26 +02:00
committed by GitHub
parent 0a4490a1f1
commit 1ca9c7ea0d
+2 -2
View File
@@ -14,11 +14,11 @@ if omarchy-cmd-present chromium || omarchy-cmd-present brave; then
if omarchy-cmd-present chromium; then
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null
chromium --refresh-platform-policy --no-startup-window &>/dev/null
pgrep -x chromium >/dev/null && chromium --refresh-platform-policy --no-startup-window &>/dev/null
fi
if omarchy-cmd-present brave; then
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null
brave --refresh-platform-policy --no-startup-window &>/dev/null
pgrep -x brave >/dev/null && brave --refresh-platform-policy --no-startup-window &>/dev/null
fi
fi