post

Dark Mode on Chromium

Many Raspberry Pi projects use the Chromium web browser to display web pages and UI screens. For instance, I wrote a kiosk program for displaying a set of web pages and I start up Chromium in a bash script, passing an array of URLs of the web pages to display:

/usr/bin/chromium-browser \
    --noerrdialogs \
    --disable-infobars \
    --kiosk ${urls[@]}

By default Chromium comes up in eye-burn mode: white screens, white backgrounds, and high glare. To get the kiosk to display the URLs in dark mode, I just had to add one extra parameter, --force-dark-mode:

/usr/bin/chromium-browser \
    --noerrdialogs \
    --disable-infobars \
    --force-dark-mode \
    --kiosk ${urls[@]}

That’s all there is to it. Chromium now comes up in dark mode.

Hope you find this useful.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.