This library was created before version 1.0 of modus-themes
. Since then a lot of changes have been made which make this library incompatible with newer versions.
Protesilaos Stavrou (the creator of modus-themes
has now released his own exporter, so please use that instead of this project.
modus-exporter
is an Emacs Lisp library for Emacs and the modus-themes. The goal of this project is to provide a set of functions allowing these themes to be exported to a variety of formats for other software.
Currently this library is only available via the GitHub repository at https://github.com/polaris64/modus-exporter. Once the library is more fully-featured I intend also to host it via ELPA and MELPA.
Simply clone the above Git repository to a local directory and add it to your load-path
. Then make sure to (require 'modus-exporter)
before using it.
(straight-use-package
'(modus-exporter :type git :host github :repo "polaris64/modus-exporter" :files '("*.el" "exporters")))
Add the following to packages.el
in your Doom configuration directory (usually ~/.doom.d/
)
(package! modus-exporter
:recipe (:type git :host github :repo "polaris64/modus-exporter" :files ("*.el" "exporters")))
This is an early prototype and as such only includes support for a couple of export formats at present: the Alacritty terminal and Tmux. Now that the concept has been proven to work more export formats will be added in due course.
Contributions of other exporters by way of pull requests would be greatly appreciated as well as general comments and suggestions for improvement.
Simply copy an existing file in the exporters
directory, give it a unique name and modify it accordingly. Each file in this directory should define a single function which outputs the specified theme in the new format and register that function in the modus-exporter-export-functions
alist with a unique name.
The intended way to use this library is by way of the modus-exporter-insert-theme-colours-at-point
function. Taking Alacritty as an example, this function can be used to export one of the themes directly to the Alacritty configuration file as follows: -
- Open alacritty.yml;
- Navigate to the
colors
section; - Delete or otherwise disable the current colour configuration;
- Place the point at the position at which the new colours should be inserted; and
- Call the above function, specify the theme to export, and finally select the format (
alacritty
).
After following the above steps the selected theme colours should be in alacritty.yml
. Simply saving the file should activate this new colour theme in all Alacritty terminals.
The procedure for other export formats once created should be the same.
NOTE: currently the theme to export must be loaded in Emacs. So for example, if exporting modus-operandi
then this theme must have been loaded previously via load-theme
. If the theme is not loaded then calling an export function specifying this theme will cause an error.