Created
February 13, 2023 11:24
-
-
Save y0n1/372f2be39243f65cbeaf9aafe0eff48f to your computer and use it in GitHub Desktop.
Enables dark mode in Google Chrome for Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
set -euo pipefail | |
google_chrome_desktop_file="/usr/share/applications/google-chrome.desktop" | |
exec_directive="Exec=/usr/bin/google-chrome-stable" | |
dark_mode_flags="--enable-features=WebUIDarkMode --force-dark-mode" | |
replace_patterns="s#${exec_directive}#${exec_directive} ${dark_mode_flags}#g" | |
sed "${replace_patterns}" "${google_chrome_desktop_file}" | sudo tee "${google_chrome_desktop_file}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment