toggle-corp / alacritty-colorscheme

Change colorscheme of alacritty with ease.
Apache License 2.0
343 stars 35 forks source link

Recursively search yaml files with themes #33

Closed Zebradil closed 2 years ago

Zebradil commented 2 years ago

Currently, alacritty-colorscheme looks for theme files only in a single directory.
This PR makes it recursively search files with yaml or yml extensions only.

This allows using several sources for theme files. For example, both repositories from the readme can be used:

REPO="https://github.com/aaron-williamson/base16-alacritty.git"
DEST="$HOME/.aarors-williamson-colorschemes"

# Get colorschemes 
git clone $REPO $DEST
# Create symlink at default colors location (optional)
ln -s "$DEST/colors" "$HOME/.config/alacritty/colors/base16"
REPO=https://github.com/eendroroy/alacritty-theme.git
DEST="$HOME/.eendroroy-colorschemes"
# Get colorschemes
git clone $REPO $DEST
# Create symlink at default colors location (optional)
ln -s "$DEST/themes" "$HOME/.config/alacritty/colors/misc"

Notice that the link names are changed from .../colors to .../colors/base16 and .../colors/misc for different theme sources.

Also notice that theme names are now prefixed with the corresponding subdirectory. For instance, alacritty-colorscheme list shows something like this:

...
base16/base16-xcode-dusk.yml
base16/base16-zenburn-256.yml
base16/base16-zenburn.yml
misc/Cobalt2.yaml
misc/afterglow.yaml
misc/argonaut.yaml
...

Other than that, no side effects were observed.
This is not a breaking change, everything should work the same after an update.