r/linuxmint on Reddit: Run Google Chrome with flags from panel shortcut

Enabling Dark Mode in Google Chrome on Linux Mint via Panel Shortcut

For Linux Mint users, enabling dark mode in Google Chrome isn't always straightforward. Sometimes, the usual settings don't work as expected. This article provides a step-by-step guide on how to force dark mode in Chrome by modifying the panel shortcut.

The Issue: Forcing Dark Mode on Linux Mint

Many users prefer dark mode for its aesthetic appeal and potential reduction in eye strain. While Chrome usually offers a built-in dark mode option, Linux users sometimes find that it doesn't function correctly. A common workaround involves using command-line flags.

The Solution: Modifying the Chrome Shortcut

The key to enabling dark mode persistently without using the terminal each time lies in modifying the Google Chrome shortcut located on your panel. Here's how:

  1. Identify the Correct Command: The command to force dark mode is:

    google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode
    
  2. Edit the Application Launcher:

    • Right-click on the Chrome shortcut in your panel.
    • Select "Edit Application". (Note: The exact wording might vary slightly depending on your desktop environment.)
    • This will open a window where you can modify the properties of the launcher.
  3. Modify the Command Field:

    • In the "Command" field or similar, you'll see the original command that launches Chrome.
    • Append the dark mode flags to the end of this command. The modified command should look something like this:
    /usr/bin/google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode
    
    • Note: The path /usr/bin/google-chrome-stable might be different on your system. Ensure you're using the correct path to the Chrome executable. You can find by typing which google-chrome-stable in the terminal
  4. Save the Changes:

    • Click "OK" or "Save" to apply the changes.
  5. Test the Shortcut:

    • Click the Chrome shortcut on your panel. Chrome should now launch with dark mode enabled

Why This Works

By adding the --enable-features=WebUIDarkMode and --force-dark-mode flags to the Chrome launcher, you're instructing Chrome to activate its dark mode features upon startup. This eliminates the need to use the terminal every time you want to run Chrome in dark mode.

Additional Tips and Considerations

  • Alternative Method: Using a .desktop File: For advanced users, you can directly edit the .desktop file associated with the Chrome launcher. These files are typically located in /usr/share/applications/ or ~/.local/share/applications/. Find the relevant .desktop file, open it with a text editor, and modify the Exec= line to include the dark mode flags. Save the file, and the changes will be reflected in your panel shortcut.
  • Reverting Changes: If you want to revert to the default Chrome theme, simply remove the added flags from the launcher's command.
  • Future Updates: Be aware that future Chrome updates might affect the functionality of these flags. Check the Chrome documentation or online forums for any changes.

By following these steps, you can easily and permanently enable dark mode in Google Chrome on Linux Mint, providing a more comfortable browsing experience.

. . .