alacritty-theme-switcher

Crates.ioalacritty-theme-switcher
lib.rsalacritty-theme-switcher
version0.1.5
sourcesrc
created_at2024-05-03 05:22:22.257795
updated_at2024-10-28 14:34:45.837394
descriptionEasily switch between color themes for Alacritty
homepage
repositoryhttps://github.com/spacebird-dev/alacritty-theme-switcher
max_upload_size
id1228386
size61,927
Max Hösel (maxhoesel)

documentation

README

alacritty-theme-switcher

A simple tool to quickly switch between different themes for alacritty, with shell completion!

./media/demo.gif

Overview

From the Alacritty website

Alacritty is a modern terminal emulator that comes with sensible defaults, but allows for extensive configuration. By integrating with other applications, rather than reimplementing their functionality, it manages to provide a flexible set of features with high performance.

By default, Alacritty does not have support for applying different themes, color configuration is instead set in the config file. The alacritty-theme provides such theme configurations, but changing the theme has to be done manually in alacritty.toml.

This tool emulates theme support for Alacritty by managing the theme configuration import in using Alacritty's configuration:

# in ~/.config/alacritty/themes/themes/my-theme.toml
[colors.primary]
background = '#282c34'
foreground = '#abb2bf'
[colors.normal]
black = '#1e2127'
red = '#e06c75'
green = '#98c379'
#...

# in ~/.config/alacritty/alacritty.toml
import = [
    "~/.config/alacritty/themes/themes/my-theme-name.toml" # 👈 this line is added and managed by alacritty-theme-switcher
]

Installation

Releases

You can get the most recent release over on the Releases section.

The downloaded archive (either .zip or .tar.gz) contains both the binary and shell completion scripts:

  • Copy the binary to a directory that's in your path, such as /usr/local/bin or ~/.local/bin
  • Copy the completion scripts for your shell into the appropriate directory:
    • For Bash: /usr/local/share/bash-completions/completions/
    • For ZSH: /usr/local/share/zsh/site-functions/

Cargo

If you have cargo installed, you can install this tool from crates.io:

cargo install --locked alacritty-theme-switcher

Note that you will have to install the shell completion scripts manually, see above.

Arch Linux

There is an AUR package available: alacritty-theme-switcher

Manually

Clone this repository, then run make build && sudo make install to compile and install the utility.

Usage

First, put some theme files into your theme directory ($XDG_CONFIG/alacritty/themes/themes by default).

Now you can switch themes by running alacritty-theme-switcher <theme-name>.

You can also list available themes with alacritty-theme-switcher -l.

Author & License

Created by @maxhoesel

Licensed under the GPL 3 (see the LICENSE file)

Commit count: 48

cargo fmt