Skip to main content

Change colorscheme of alacritty with ease

Project description

Alacritty Colorscheme

Change colorscheme of alacritty with ease.

Usage

Usage

usage: alacritty-colorscheme [-h] (-s | -l | -a colorscheme | -t colorschemes [colorschemes ...] | -T) [-c configuration file] [-C colorscheme directory] [-V]

Change colorscheme of alacritty with ease.

optional arguments:
  -h, --help            show this help message and exit
  -s, --show-applied    Show applied colorscheme
  -l, --list-available  List available colorschemes
  -a colorscheme, --apply colorscheme
                        Apply colorscheme
  -t colorschemes [colorschemes ...], --toggle colorschemes [colorschemes ...]
                        Toggle colorschemes
  -T, --toggle-available
                        Toggle all available colorschemes
  -c configuration file, --config-file configuration file
                        Path to configuration file
  -C colorscheme directory, --colorscheme-directory colorscheme directory
                        Path to colorscheme directory
  -V, --base16-vim      Support base16-vim

Installation

You can install it from pip:

pip install --user alacritty-colorscheme

Running locally

# Get program
git clone https://github.com/toggle-corp/alacritty-colorscheme.git

# Install
poetry install
poetry run python alacritty_colorscheme/cli.py

Getting themes

You can get themes from aaron-williamson/base16-alacritty

DEST="~/.aaron-williamson-alacritty-theme"

# Get themes
git clone https://github.com/aaron-williamson/base16-alacritty.git $DEST

# List available themes
alacritty-colorscheme -C $DEST/colors -l

# Toggle between the themes
alacritty-colorscheme -C $DEST/colors -T

You can alternatively get themes from from eendroroy/alacritty-theme

DEST="~/.eendroroy-alacritty-theme"

# Get themes
git clone https://github.com/eendroroy/alacritty-theme.git $DEST

# List available themes
alacritty-colorscheme -C $DEST/themes -l

# Toggle between the themes
alacritty-colorscheme -C $DEST/themes -T

Synchronizing with vim/neovim

If you are using base16 colorschemes from base16-vim, you can use the -V argument to generate ~/.vimrc_background file while changing alacritty colorscheme.

You will need to source the file in your vimrc to load the appropriate colorscheme in vim. Add the following in your vimrc file:

if filereadable(expand("~/.vimrc_background"))
  let base16colorspace=256          " Remove this line if not necessary
  source ~/.vimrc_background
endif

After changing alacritty colorscheme, you need to simply reload your vimrc configuration.

Reloading neovim

If you are using neovim, you can use neovim-remote to reload the nvim sessions externally.

Install neovim-remote:

pip install --user neovim-remote

Reload a neovim session using:

nvr -cc "source ~/.config/nvim/init.vim"

Example bash/zsh configuration (base16-vim + neovim + neovim-remote)

You can add this example configuration in your .zshrc or .bashrc to switch between dark and light theme. This snippet creates two aliases namely: day, night

function reload_nvim {
    for SERVER in $(nvr --serverlist); do
        nvr -cc "source ~/.config/nvim/init.vim" --servername $SERVER &
    done
}

COLOR_DIR="~/.aaron-williamson-alacritty-theme/colors"
LIGHT_COLOR='base16-gruvbox-light-soft.yml'
DARK_COLOR='base16-gruvbox-dark-soft.yml'

alias day="alacritty-colorscheme -C $COLOR_DIR -a $LIGHT_COLOR -V && reload_nvim"
alias night="alacritty-colorscheme -C $COLOR_DIR -a $DARK_COLOR -V && reload_nvim"

Bindings for i3wm/sway

# Toggle between light and dark colorscheme
bindsym $mod+Shift+n exec alacritty-colorscheme -t solarized-light.yml solarized-dark.yml

# Toggle between all available colorscheme
bindsym $mod+Shift+m exec alacritty-colorscheme -T

# Get notification with current colorscheme
bindsym $mod+Shift+b exec notify-send "Alacritty Colorscheme" `alacritty-colorscheme -s`

License

Content of this repository is released under the [Apache License, Version 2.0].

Apache License, Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alacritty-colorscheme-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

alacritty_colorscheme-0.1.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file alacritty-colorscheme-0.1.1.tar.gz.

File metadata

  • Download URL: alacritty-colorscheme-0.1.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.3 Linux/5.6.14-arch1-1

File hashes

Hashes for alacritty-colorscheme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 36f17f3d3ee676675796947a17851c6a5b65a5dfcd40caf42adcb069605b03cd
MD5 0bc48187d2bace7d881d344767dd9bf3
BLAKE2b-256 7b8d2f47ff6d29524fcdc537a36ec640da33b36cfcadbed03e7d02b9b239a8d5

See more details on using hashes here.

File details

Details for the file alacritty_colorscheme-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for alacritty_colorscheme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2ad5d261e6fc667aaf25992d1bb419917beb0103adf466fab90d1b3eda50349
MD5 95904622a3d29e55a6870dccfadb8184
BLAKE2b-256 d66e325659d9c1e5eac3184bc44ddbe93575362f97c74086274aeb043fcf3f26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page