Set Chromium colour theme to match system
The current system theme is kind of orange, but Chromium starts up as a blue theme inside the window. In a new tab, at bottom-right of the window, there is a "Customize Chromium" button, where you can choose a colour theme.
However, I would like to set it automatically appropriately as the default. In /root/.packages/default-theme, there is a new variable:
#choose chromium theme (default is blue). allowed values: "orange", "yellow"
DEFAULT_THEME_CHROMIUM='orange'
In woofQ2, script woofq2/rootfs/4post-process-rootfs reads this
and appends the appropriate text:
#chromium theme (default is blue)...
case "$DEFAULT_THEME_CHROMIUM" in
orange) echo -n ',"theme":{"color_variant2":1,"user_color2":-32768}' >> rootfs/root/.config/chromium/Default/Preferences ;;
yellow) echo -n ',"theme":{"color_variant2":1,"user_color2":-336013}' >> rootfs/root/.config/chromium/Default/Preferences ;;
esac
However, as Chromium defaults to run as user "chromium", the script /usr/bin/chromium will copy these default settings into /home/chromium:
if [ ! -d /home/chromium/.config/chromium/Default ];then
mkdir -p /home/chromium/.config/chromium
cp -a /root/.config/chromium/Default /home/chromium/.config/chromium/
cp -a -f "/root/.config/chromium/Local State" /home/chromium/.config/chromium/
chown -R ${UGID}:${UGID} /home/chromium
However, this will only work in a new installation, when Chromium has not yet been run. If you are updating an existing installation, you will have to manually choose the colour theme, as described in the first paragraph above.
I was thinking, if a later version of Easy reverted to a blue theme, perhaps a version update could delete that /home/chromium/.config/chromium/Preferences file, but that would wipe out other preferences.
EDIT 2026-06-18:
I received an email from Otto, advising me of an alternative
method to set the Chromium theme. He sent this link:
https://www.januschka.com/chromium-omarchy.html
...this is very interesting. It offers a lot to think about, but a quick implementation is this in the '4post-process-rootfs' script:
case "$DEFAULT_THEME_CHROMIUM" in
orange) Bclr='ff8b55' ;;
yellow) Bclr='fff065' ;;
grey) Bclr='a0a0a0' ;;
*) Bclr='559bff' ;; #blue
esac
mkdir -p rootfs/etc/chromium/policies/managed
echo "{
\"BrowserThemeColor\": \"#${Bclr}\"
}" > rootfs/etc/chromium/policies/managed/theme.json
A downside is that it disables user-setting of theme from within Chromium.
Tags: easy