This script toggles both the Pop!_OS theme between Pop-dark
and Pop
and the gnome color-theme preference between prefer-light
and prefer-dark
at once. We need to toggle both because some apps use one and some the other. In particular, the CSS feature that allows detection of user preferences uses org.gnome.desktop.interface color-scheme
, while native apps mostly use the gtk-theme
.
To use it, you could just run the script manually from a terminal (. theme-toggle.sh
or chmod a+x theme-toggle.sh
and then ./theme-toggle.sh
), but that's no fun.
Instead, you can add a desktop-wide keyboard shortcut that triggers this script.
To do so, open Settings (gnome-control-center
) and go to Keyboard
> Keyboard Shortcuts
> View and Customize Keyboard Shortcuts
.