Change Emacs’ theme based on the theme mode (light or dark) of Cosmic Desktop. This package watches Cosmic’s theme mode option, and accordingly switches the Emacs theme to a user-specified light or dark theme.
First, one should install the package from source.
Then, one can configure the package using use-package like so (in this example, using the Modus themes):
(use-package cosmic-theme-watcher
:custom
(cosmic-theme-watcher-light-theme 'modus-operandi)
(cosmic-theme-watcher-dark-theme 'modus-vivendi)
:config
(cosmic-theme-watcher-mode))The cosmic-theme-watcher-light-theme and cosmic-theme-watcher-dark-theme variables should be set to themes associated to light and dark mode, respectively.
The themes will be loaded using the function configured in cosmic-theme-watcher-load-theme-function, which defaults to (lambda (theme) (load-theme theme t)).
The variable cosmic-theme-watcher-theme-mode-file should point to the is_dark file storing Cosmic’s theme mode configuration value; by default, it is ~/.config/cosmic/com.system76.CosmicTheme.Mode/v1/is_dark.