How to make Chrome and other Chromium-based browsers allow us to view dark mode content on Linux

Dark mode in Chrome pages on Linux

when i had to use Chrome on Windows or macOS, viewing the content in its dark mode has not been a problem for me. However, on Linux yes. For me, who does not like light themes, it has always seemed strange to me, for example, opening the developer tools and seeing a dark part and another, the code part, in white. It's something that hasn't happened to me on Windows, and there is a way to get it on Linux.

This works for browsers Chromium-based that don't offer an option on their own, like Brave. The "brave" browser changes everything to dark if we choose its dark theme, but this is not the case in Chrome or in Vivaldi. If it can be achieved in the same way in both cases, where to do it is a minute away. And the dark mode that we will achieve will not be anything forced, for what it is worth.

Dark mode in Chrome/Chromium and derivatives

If your distribution and your browser do not allow you to see the pages as in the header image, you just have to open a terminal and type:

sudo gedit /usr/share/applications/google-chrome.desktop

Inside, we search for google-chrome-stable and change the lines that have Exec=/usr/bin/google-chrome-stable %U y Exec=/usr/bin/google-chrome-stable adding them --enable-features=WebUIDarkMode --force-dark-mode in the end. In the case of Vivaldi, the file to modify is vivaldi-stable.desktop and the line to which the options are added is Exec=/usr/bin/vivaldi-stable %U. They should be like Exec=/usr/bin/google-chrome %U --enable-features=WebUIDarkMode --force-dark-mode, changing the executable depending on the browser we are using. And for everything to be consistent, then you have to install and activate a dark theme like this.

The bad thing about this method, which allows us to see the dark pages as it should be without forcing anything, is that stops working every time the browser is refreshed and recreate a new .desktop file. This not changing theme with OS theme is a known bug, but it hasn't been fixed in years. In the meantime, we can see everything with this little trick.


Leave a Comment

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

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.