mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-02 04:37:49 +02:00
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
25 lines
1023 B
Bash
Executable File
25 lines
1023 B
Bash
Executable File
#!/bin/bash
|
|
|
|
CHROMIUM_THEME=~/.config/omarchy/current/theme/chromium.theme
|
|
|
|
if omarchy-cmd-present chromium || omarchy-cmd-present brave; then
|
|
if [[ -f $CHROMIUM_THEME ]]; then
|
|
THEME_RGB_COLOR=$(<$CHROMIUM_THEME)
|
|
THEME_HEX_COLOR=$(printf '#%02x%02x%02x' ${THEME_RGB_COLOR//,/ })
|
|
else
|
|
# Use a default, neutral grey if theme doesn't have a color
|
|
THEME_RGB_COLOR="28,32,39"
|
|
THEME_HEX_COLOR="#1c2027"
|
|
fi
|
|
|
|
if omarchy-cmd-present chromium; then
|
|
echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/chromium/policies/managed/color.json" >/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
|
|
pgrep -x brave >/dev/null && brave --refresh-platform-policy --no-startup-window &>/dev/null
|
|
fi
|
|
fi
|