Skip to content

Instantly share code, notes, and snippets.

@wisentini
Last active October 20, 2022 09:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wisentini/430b43cb4c9acc3ffadcacdd8f43a6c3 to your computer and use it in GitHub Desktop.
Save wisentini/430b43cb4c9acc3ffadcacdd8f43a6c3 to your computer and use it in GitHub Desktop.
Enable dark mode on Google Chrome under Linux (GNOME environment).

Enable dark mode on Google Chrome under Linux (GNOME environment)

  1. Create a new google-chrome.desktop file using Chrome's default:

    cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop
  2. Edit the google-chrome.desktop file that was just created:

    gedit ~/.local/share/applications/google-chrome.desktop
  3. Search for Exec and append --enable-features=WebUIDarkMode --force-dark-mode to the end of the line each time it appears (about 3 times):

    # before
    Exec=/usr/bin/google-chrome-stable %U
    
    # after
    Exec=/usr/bin/google-chrome-stable %U --enable-features=WebUIDarkMode --force-dark-mode
  4. (Optional) You can set Chrome's Settings > Appearance > Theme to use Classic instead of GTK+. It looks better in my opinion.

  5. Restart Chrome.

Glossary

.desktop: A shortcut to an application that will appear when searching applications. Contains config information on how the shortcut will look and how to launch the application. Any exectable can have a GUI shortcut by adding a .desktop file to ~/.local/share/applications/.

Exec: The actual CLI command that launchs the application executable. Command line options can be added here.

Credits

This guide was adapted from Chris Hayes' answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment