GithubHelp home page GithubHelp logo

codecopy / alacritty-colorscheme Goto Github PK

View Code? Open in Web Editor NEW

This project forked from toggle-corp/alacritty-colorscheme

0.0 0.0 0.0 38 KB

Change colorscheme of alacritty with ease.

License: Apache License 2.0

Python 100.00%

alacritty-colorscheme's Introduction

Alacritty Colorscheme

Change colorscheme of alacritty with ease.

Usage

Usage

usage: alacritty-colorscheme [-h] (-s | -l | -a colorscheme | -t colorschemes [colorschemes ...] | -T) [-r] [-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
  -r, --reverse-toggle  Toggle through colorschemes in reverse order
  -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

# Install poetry
pip install --user poetry

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

# Run program
cd alacritty-colorscheme
poetry install
poetry run python alacritty_colorscheme/cli.py

Getting themes

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

DEST="$HOME/.aaron-williamson-alacritty-theme"

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

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

DEST="$HOME/.eendroroy-alacritty-theme"

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

Synchronizing with vim/neovim

If you are using base16 colorschemes from base16-vim, you can use the -V argument to generate ~/.vimrc_background file when you change 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="$HOME/.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"

Example i3wm/sway configuration

set $color_dir $HOME/.aaron-williamson-alacritty-theme/colors
set $light_color base16-gruvbox-light-soft.yml
set $dark_color base16-gruvbox-dark-soft.yml

# Toggle between light and dark colorscheme
bindsym $mod+Shift+n exec alacritty-colorscheme -C $color_dir -t $light_color $dark_color

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

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

License

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

Apache License, Version 2.0

alacritty-colorscheme's People

Contributors

adityakhatri avatar frozenhelium avatar moreheadm avatar thenav56 avatar tnagorra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.