A script for setting your Alacritty theme that uses an intermediary theme.toml
file
to keep track of the current theme in order to keep your primary Alacritty configuration safe from accidental modifications.
This script makes the following assumptions:
- You have cloned alacritty/alacritty-theme into
$HOME/.config/alacritty/themes
- You import
$HOME/.config/alacritty/theme.toml
from$HOME/.config/alacritty/alacritty.toml
Additionally, when setting a theme with an underscore in the filename (eg. github_dark.toml
) you can instead use a dash instead: github-dark
.
Getting the current theme
~/.config/alacritty
❯ ./alacritty-theme.sh current
Current theme: github_light
Listing available themes
~/.config/alacritty
❯ ./alacritty-theme.sh list
Available themes:
afterglow
alabaster_dark
alabaster
...
Setting the theme
~/.config/alacritty
❯ ./alacritty-theme.sh set github-dark
Theme changed to github_dark