Linux Mint offers a user-friendly experience, but sometimes achieving a desired customization requires a bit of tweaking. One such example is forcing dark mode in Google Chrome. While Chrome has a dark mode setting, it may not always be easily accessible or function as expected on Linux. This article provides a step-by-step guide, inspired by a Reddit thread, on how to force dark mode in Chrome on Linux Mint by modifying the panel shortcut.
Many users prefer dark mode for its aesthetic appeal and potential to reduce eye strain. However, enabling dark mode in Chrome on Linux can be tricky. Some users find that the standard settings don't work reliably. The solution? Using command-line flags when launching Chrome.
Chrome flags are special command-line options that can modify Chrome's behavior. In this case, we'll use two flags to force dark mode:
--enable-features=WebUIDarkMode
: Enables the experimental dark mode feature for Chrome's user interface.--force-dark-mode
: Forces websites to render in dark mode, even if they don't natively support it.Here’s how to modify the Chrome launcher on your panel to include these flags:
Locate the Chrome Launcher: Find the Google Chrome icon on your panel (the taskbar at the bottom or top of your screen).
Unpin the Existing Launcher (If Necessary): If the icon is pinned, you may need to unpin it first. Right-click the icon and select "Unpin from Panel" or a similar option. This step is important because you'll be creating a custom launcher to replace it.
Create a New Desktop Entry: Desktop entries are configuration files that define how applications are launched in Linux. You'll need to create or modify one for Chrome.
google-chrome-dark.desktop
(or any descriptive name) and save it in ~/.local/share/applications/
. The ~
represents your home directory. This location ensures the launcher is available for your user.Edit the Desktop Entry File: Paste the following content into the file, modifying the Exec=
line to include the flags:
[Desktop Entry]
Name=Google Chrome Dark
Comment=Web Browser with Dark Mode Forced
Exec=/usr/bin/google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode
Icon=google-chrome
Terminal=false
Type=Application
Categories=Network;WebBrowser;
* **Important:**
* **`Name=`:** This is the name that will appear under the icon.
* **`Exec=`:** This is the command that will be executed when you click the icon. Ensure `/usr/bin/google-chrome-stable` matches the actual path to your Chrome executable. You can find this by typing `which google-chrome-stable` in the terminal.
* **`Icon=`:** This specifies the icon to use. "google-chrome" should work if Chrome is properly installed.
* **`Terminal=false`:** Prevents a terminal window from opening when you launch Chrome.
5. Save the File: Save the google-chrome-dark.desktop
file.
chmod +x ~/.local/share/applications/google-chrome-dark.desktop
This command makes the desktop entry executable. This step may not always be necessary, but it ensures the system can properly use the file.
7. Find and Pin the New Launcher: Open your application menu (usually by clicking the Linux Mint icon). Search for "Google Chrome Dark" (or whatever you named the .desktop
file). Right-click on it and select "Add to Panel".
Depending on how your panel is configured, you might be able to directly edit the existing Chrome launcher.
Right-Click and Edit (If Available): Right-click the Chrome icon on the panel. If there's an option like "Edit Application" or "Properties," select it.
Modify the Command: In the properties window, find the "Command" or "Exec" field and add the flags --enable-features=WebUIDarkMode --force-dark-mode
to the end of the existing command.
Save and Test: Save the changes and click the Chrome icon to test if dark mode is enabled.
Exec=
line of the .desktop
file. Use the which google-chrome-stable
command in the terminal to confirm the correct path.--
). Also, make sure Chrome is up to date.Icon=
line in the .desktop
file. You can try specifying the full path to the Chrome icon if necessary (e.g., /usr/share/icons/hicolor/256x256/apps/google-chrome.png
).By following these steps, you can effectively force dark mode in Google Chrome on Linux Mint using a modified panel shortcut. This provides a consistent dark theme for both the Chrome interface and web content, enhancing your browsing experience. Remember to adjust the commands and paths according to your specific system configuration. You can also explore other Chrome flags to further customize your browser's behavior. For more information on Chrome flags, refer to the official Chromium documentation.