diff --git a/install/config/theme.sh b/install/config/theme.sh index 439ec08d..0dab91ad 100644 --- a/install/config/theme.sh +++ b/install/config/theme.sh @@ -24,4 +24,4 @@ sudo mkdir -p /etc/brave/policies/managed sudo chmod a+rw /etc/brave/policies/managed # Default Chromium to follow system appearance ("device") instead of dark -echo '{"browser":{"theme":{"color_scheme":0}}}' | sudo tee /usr/lib/chromium/initial_preferences >/dev/null +echo '{"browser":{"theme":{"color_scheme":0,"color_scheme2":0}}}' | sudo tee /usr/lib/chromium/initial_preferences >/dev/null diff --git a/migrations/1777018408.sh b/migrations/1777018408.sh new file mode 100644 index 00000000..af644b53 --- /dev/null +++ b/migrations/1777018408.sh @@ -0,0 +1,9 @@ +echo "Fix Chromium appearance mode to also set color_scheme2 (the field Chromium actually reads now)" + +echo '{"browser":{"theme":{"color_scheme":0,"color_scheme2":0}}}' | sudo tee /usr/lib/chromium/initial_preferences >/dev/null + +# Update existing Chromium profiles so color_scheme2 follows the system, not dark +PREFS="$HOME/.config/chromium/Default/Preferences" +if [[ -f "$PREFS" ]] && command -v jq &>/dev/null; then + jq '.browser.theme.color_scheme = 0 | .browser.theme.color_scheme2 = 0' "$PREFS" > "$PREFS.tmp" && mv "$PREFS.tmp" "$PREFS" +fi