convoluted

An Example and Concise Guide to Alacritty Configuration through TOML

screengrab

by Rito Ghosh

(Originally a GitHub Gist.)

Alacritty now uses TOML formatting for its config files. This is a simple example.

There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd.

ss from repo

But it is not obvious how it translates to TOML. But it is extremely straightforward.

"WINDOW", "COLORS", "Scrolling", "Font" etc. are tables, and should be represented as [window], [colors], [scrolling], [font] respectively.

Specifics of variables go under them. e.g.- look under "dynamic_padding" under the WINDOW section.

Write dynamic_padding = true under the table [window].

For variables with multiple values, use "dotted keys". Like setting padding.x = 5 under [window].

This is very simple. If it is not clear, do several trials and errors. And look the concrete example below which was my first alacritty config.

The examples on TOML homepage was very helpful in figuring this out.

I put the file alacritty.toml under $HOME/.config/alacritty. However it can be kept anywhere among the places mentioned in the configurations section of the alacritty README.

# $HOME/.config/alacritty/alacritty.toml
# by Rito Ghosh 2023-10-06

[window]

opacity = 0.9

padding.x = 10
padding.y = 10

decorations = "Full"
decorations_theme_variant = "Light" # "Dark"

[font]

normal.family = "Cascadia Code PL"
bold.family = "Cascadia Code PL"
italic.family = "Cascadia Code PL"
bold_italic.family = "Cascadia Code PL"

size = 15.0

💡 Tip: for inspiration, look for values in the source code files of your favorite VS Code themes, and use the color picker in Google to test colors before setting a value, or simply using an editor such as VS Code where colors are displayed in a small box when a HEX is detected by the editor.

Hope it helped you.


Consider buying me a coffee. Due to currency conversion rates, even small amounts in USD are meaningful to me.

#alacritty #config #dotfiles #toml