A theme that retrieves pywal colors and generates a theme using modus-themes theme generation functions.
The package is available on MELPA, so you can install it with package-install, use-package or other package manager.
load-theme should work.
If you don’t have the pywal cache file or it’s not made right, the theme will not load, and you will be messaged about it. In such case, you may need to load the package again.
The theme loads new pywal colors on every load, so invoke load-theme after loading a new pywal colorscheme.
You can automate it by adding a file watcher like this:
(file-notify-add-watch ewal-json-file '(change)
(lambda (&rest _) (load-theme 'modus-ewal t)))(load-theme 'modus-ewal t) will work if you don’t use Emacs daemon.
The colors will not look right though if Emacs is run as a daemon.
Adding the load-theme to server-after-make-frame-hook will make it work.
Here is an example configuration that covers both cases:
(use-package modus-ewal-theme
:config
(unless (daemonp)
(load-theme 'modus-ewal t))
(defun custom-modus-ewal-theme-load-once ()
(and (not (member 'modus-ewal custom-enabled-themes))
(load-theme 'modus-ewal t))
;; once run, it can be removed
(remove-hook 'server-after-make-frame-hook
#'custom-modus-ewal-theme-load-once))
(add-hook 'server-after-make-frame-hook
#'custom-modus-ewal-theme-load-once))modus-ewal-theme-custom-faces can be used to customize certain faces.
The changes will be visible after loading the theme again.
For example, to customize a face, you can add a face configuration like this:
(add-to-list 'modus-ewal-theme-custom-faces
(quote `(show-paren-match ((,c :foreground "green")))))The quote function is neccessary as we don’t want the c variable to be evaluated yet.
We can also change the values whether the theme is light or dark like this:
(add-to-list 'modus-ewal-theme-custom-faces
(quote `(show-paren-match
((,c :foreground
,(if (modus-themes-color-dark-p bg-main)
"red"
"blue"))))))Instead of red, green, blue or other simple colors, you can use modus color variables that you can see in modus-ewal-theme-modus-palette variable.
- The maintainers of ewal
- Protesilaos Stavrou for adding theme generating functionality to Modus Themes

