initial commit
This commit is contained in:
24
bin/nomarchy-theme-set-browser
Executable file
24
bin/nomarchy-theme-set-browser
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
CHROMIUM_THEME=~/.config/nomarchy/current/theme/chromium.theme
|
||||
|
||||
if nomarchy-cmd-present chromium || nomarchy-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 nomarchy-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
|
||||
fi
|
||||
|
||||
if nomarchy-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
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user