Add logic to theme-set for brave browser, macos not working so far
This commit is contained in:
@@ -36,6 +36,23 @@ theme_update_neovim() {
|
||||
done
|
||||
}
|
||||
|
||||
theme_update_browser() {
|
||||
policy='BrowserThemeColor'
|
||||
color_hex=$(
|
||||
printf '#%02x%02x%02x' $(
|
||||
cat $DIR_THEME_SETTINGS/.current-theme/brave.theme | tr ',' ' '
|
||||
)
|
||||
)
|
||||
[[ "$OSTYPE" != *"darwin"* ]] && {
|
||||
echo "{\"$policy\": \"$color_hex\"}" > "/etc/brave/policies/managed/color.json"
|
||||
} || {
|
||||
# currently not working, property is set and seen by brave, but colors are not
|
||||
# actually applied, leaving here as is for now; TODO: fix or just remove
|
||||
defaults write com.brave.browser $policy -string "$color_hex"
|
||||
}
|
||||
brave --refresh-platform-policy --no-startup-window
|
||||
}
|
||||
|
||||
[[ ! -z $1 ]] && raw_target="$1" ||
|
||||
raw_target=$(
|
||||
find $DIR_THEME_SETTINGS -mindepth 1 -maxdepth 1 -type d -exec basename -- {} \; |
|
||||
@@ -50,8 +67,8 @@ ln -sF "$target_theme" $DIR_THEME_SETTINGS/.current-theme
|
||||
theme_update_terminal
|
||||
theme_update_tmux
|
||||
theme_update_neovim &
|
||||
theme_update_browser
|
||||
# theme_update_obsidian # TODO: decide if theming beyond transparency is worth it, if so, implement
|
||||
# theme_update_browser # TODO: implement
|
||||
# theme_update_reaper # TODO: implement
|
||||
# theme_update_mutt # TODO: possible and actually desired?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user