From 691b11901c8a4e8edb5c3f1c1b1bf1212e83ab1f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 11 Apr 2026 20:09:51 -0400 Subject: [PATCH] Set device appearance as the default for chromium So we will be switching correctly from light/dark mode depending on the theme. --- install/config/theme.sh | 3 +++ migrations/1775946416.sh | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 migrations/1775946416.sh diff --git a/install/config/theme.sh b/install/config/theme.sh index 8bb3c603..439ec08d 100644 --- a/install/config/theme.sh +++ b/install/config/theme.sh @@ -22,3 +22,6 @@ sudo chmod a+rw /etc/chromium/policies/managed 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 diff --git a/migrations/1775946416.sh b/migrations/1775946416.sh new file mode 100644 index 00000000..8e537976 --- /dev/null +++ b/migrations/1775946416.sh @@ -0,0 +1,9 @@ +echo "Set Chromium appearance mode to device (follow system) by default" + +echo '{"browser":{"theme":{"color_scheme":0}}}' | sudo tee /usr/lib/chromium/initial_preferences >/dev/null + +# Update existing Chromium profiles to use "device" instead of "dark" +PREFS="$HOME/.config/chromium/Default/Preferences" +if [[ -f "$PREFS" ]] && command -v jq &>/dev/null; then + jq '.browser.theme.color_scheme = 0' "$PREFS" > "$PREFS.tmp" && mv "$PREFS.tmp" "$PREFS" +fi