Skip to content

Instantly share code, notes, and snippets.

@sansmoraxz
Created May 6, 2023 05:39
Show Gist options
  • Save sansmoraxz/dd8dc5cbccb87cde2c89b1fe99fb2e02 to your computer and use it in GitHub Desktop.
Save sansmoraxz/dd8dc5cbccb87cde2c89b1fe99fb2e02 to your computer and use it in GitHub Desktop.
Script for setting color mode at launch based on current theme
#!/bin/bash
colorscheme=$(gsettings get org.gnome.desktop.interface color-scheme)
# start chrome in dark mode if dark theme
if [[ $colorscheme == *"dark"* ]]; then
/usr/bin/google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode "$@"
else
/usr/bin/google-chrome-stable "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment