polaris64 / modus-exporter

An Emacs Lisp library for exporting modus-themes to different formats for other software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modus-exporter

Important note

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.

Introduction

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.

Installation

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.

Manually

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.

Via straight.el

(straight-use-package
 '(modus-exporter :type git :host github :repo "polaris64/modus-exporter" :files '("*.el" "exporters")))

In Doom Emacs

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")))

Current progress

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

Contributions of other exporters by way of pull requests would be greatly appreciated as well as general comments and suggestions for improvement.

Adding an exporter

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.

How to use

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: -

  1. Open alacritty.yml;
  2. Navigate to the colors section;
  3. Delete or otherwise disable the current colour configuration;
  4. Place the point at the position at which the new colours should be inserted; and
  5. 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.

About

An Emacs Lisp library for exporting modus-themes to different formats for other software

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%