/alacritty-shell

A (zsh) plugin to control alacritty color themes.

Primary LanguageShellMIT LicenseMIT

alacritty-shell

zsh alacritty-shell plugin

alacritty-shell is a dynamic theme chooser based on the alacritty.yml schemes: setttings

Themes need to be defined for this pluging to work correctly see: Alacritty themes wiki

example install with zinit

zinit wait lucid for \
  OMZL::key-bindings.zsh \
  OMZL::history.zsh \
  OMZP::git \
  casonadams/alacritty-shell \
  casonadams/skim.zsh \
  ;

NOTE recommended to install yq manually see manual install / yq section for more information. Other wise an attempt will be made to auto install the yq binary. Not supported for all platforms

manual install

yq

yq is used to parse the alacritty.yml file and needs to be installed in the $PATH.

example install command for x86_64 linux

NOTE ~/.local/bin/ needs to be in the $PATH

curl -L https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_amd64 -o ~/.local/bin/yq
chmod +x ~/.local/bin/yq

bash/zsh

Add following lines to ~/.bashrc or ~/.zshrc:

if [ ! -d "${HOME}/.config/alacritty-shell" ]; then
  git clone https://github.com/casonadams/alacritty-shell.git ~/.config/alacritty-shell
fi

ALACRITTY_SHELL="${HOME}/.config/alacritty-shell"
[ -n "$PS1" ] \
  && [ -s "${ALACRITTY_SHELL}/profile_helper.sh" ] \
  && eval "$("${ALACRITTY_SHELL}/profile_helper.sh")"

restart shell

setup alacritty themes

Alacritty color-schemes desribes how to use multiple schemes.

Alacritty themes wiki

other examples

  • Note use the 256 themes
  • add index: 208 = orange
  • add index: 247 = highlight dark is +5 lightness, and light is -5 lightness to the background color

change terminal colors

alacritty_theme_name

using with vim

install walh colorscheme

set notermguicolors
colorscheme walh-gruvbox

Note not tested on windows (probably won't work) open to MRs to support it though