Fork the desktop off Omarchy as a self-contained system
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# blob:summary=Apply the current theme color to Chromium, Chrome, Edge, and Brave
|
||||
# blob:hidden=true
|
||||
|
||||
source "$BLOB_PATH/install/helpers/browser-policy.sh"
|
||||
|
||||
CHROMIUM_THEME=$HOME/.local/state/blob/current/theme/chromium.theme
|
||||
THEME_HEX_COLOR=$BROWSER_POLICY_DEFAULT_COLOR
|
||||
|
||||
if [[ -f $CHROMIUM_THEME ]]; then
|
||||
THEME_HEX_COLOR=$(browser_policy_theme_hex "$(<$CHROMIUM_THEME)")
|
||||
fi
|
||||
|
||||
refresh_running_browser() {
|
||||
local process="$1"
|
||||
local command="$2"
|
||||
local pgrep_args="${3:--x}"
|
||||
|
||||
if blob-cmd-present "$command" && pgrep $pgrep_args "$process" >/dev/null; then
|
||||
"$command" --refresh-platform-policy --no-startup-window &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
failed=0
|
||||
blob-theme-browser-policy "${THEME_HEX_COLOR#\#}" || failed=1
|
||||
|
||||
refresh_running_browser chromium chromium
|
||||
refresh_running_browser chrome google-chrome-stable || refresh_running_browser chrome google-chrome
|
||||
refresh_running_browser msedge microsoft-edge-stable
|
||||
refresh_running_browser brave brave
|
||||
# Match on the binary path: the running process is named plain "brave", and a
|
||||
# bare -f brave-origin pattern would also match the installer's own terminal.
|
||||
refresh_running_browser /opt/brave-origin-bin/ brave-origin -f
|
||||
|
||||
exit "$failed"
|
||||
Reference in New Issue
Block a user