diff --git a/README.md b/README.md index b428399..1a8e1a6 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ # Alacritty config builder -Simple shell script to generate multiple Alacritty config files from a shared base. +Simple shell script to generate Alacritty config file. ## Structure - `src/base.toml` contains common settings -- Other files contain appearance or size variants -- `build.sh` concatenates base + variant into final configs +- `src/light.toml` contains light theme settings. +- `src/dark.toml` contains dark theme settings. +- `build.sh` concatenates base + variant into final config. ## Usage ```sh +./build.sh dark +./build.sh light + +# defaults to light. ./build.sh ``` -Generated files are written to `./`. +Generated file is written to `./alacritty.toml`. -Edit source files only. Generated files are disposable. +**Edit source files only**. diff --git a/build.sh b/build.sh index b486d7b..99c18e9 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,18 @@ #!/bin/sh +set -e -SRC=./src -OUT=. +SRC_DIR=./src +OUT_FILE=./alacritty.toml -cat "$SRC/base.toml" "$SRC/default.toml" > "$OUT/alacritty.toml" -cat "$SRC/base.toml" "$SRC/small.toml" > "$OUT/alacritty--small.toml" -cat "$SRC/base.toml" "$SRC/light.toml" > "$OUT/alacritty--light.toml" -cat "$SRC/base.toml" "$SRC/light-small.toml" > "$OUT/alacritty--light-small.toml" -cat "$SRC/base.toml" "$SRC/light-large.toml" > "$OUT/alacritty--light-large.toml" +mode="${1:-light}" +case "$mode" in +light|dark) ;; +*) + echo "Usage: $0 [light|dark]" >&2 + exit 1 + ;; +esac +theme="$SRC_DIR/$mode.toml" + +cat "$SRC_DIR/base.toml" "$theme" > "$OUT_FILE" diff --git a/src/base.toml b/src/base.toml index b17e045..8686696 100644 --- a/src/base.toml +++ b/src/base.toml @@ -9,6 +9,33 @@ TERM = "alacritty" animation = "EaseOutExpo" duration = 0 +[font] +size = 11.0 + +[font.bold] +family = "SourceCodePro" +style = "Bold" + +[font.bold_italic] +family = "OperatorMono" +style = "Medium Italic" + +[font.glyph_offset] +x = 0 +y = 0 + +[font.italic] +family = "SourceCodePro" +style = "Semibold Italic" + +[font.normal] +family = "SourceCodePro" +style = "Semibold" + +[font.offset] +x = -1 +y = 0 + [[keyboard.bindings]] action = "Paste" key = "V" diff --git a/src/small.toml b/src/dark.toml similarity index 54% rename from src/small.toml rename to src/dark.toml index 5bd2ab1..02bf2cf 100644 --- a/src/small.toml +++ b/src/dark.toml @@ -21,30 +21,3 @@ yellow = "#e1a574" [colors.primary] background = "#27292c" foreground = "#a9abaa" - -[font] -size = 9.0 - -[font.bold] -family = "SourceCodePro" -style = "Bold" - -[font.bold_italic] -family = "OperatorMono" -style = "Medium Italic" - -[font.glyph_offset] -x = 0 -y = 0 - -[font.italic] -family = "SourceCodePro" -style = "Semibold Italic" - -[font.normal] -family = "SourceCodePro" -style = "Semibold" - -[font.offset] -x = -1 -y = 0 diff --git a/src/default.toml b/src/default.toml deleted file mode 100644 index c3b5e60..0000000 --- a/src/default.toml +++ /dev/null @@ -1,50 +0,0 @@ -[colors.bright] -black = "#484c52" -blue = "#96b1c9" -cyan = "#9fc9c3" -green = "#dffebe" -magenta = "#bfa5c7" -red = "#d27c7b" -white = "#fcf7e2" -yellow = "#f0d189" - -[colors.normal] -black = "#35383b" -blue = "#7693ac" -cyan = "#749e99" -green = "#769972" -magenta = "#977ba0" -red = "#b05655" -white = "#848b92" -yellow = "#e1a574" - -[colors.primary] -background = "#27292c" -foreground = "#a9abaa" - -[font] -size = 11.0 - -[font.bold] -family = "SourceCodePro" -style = "Bold" - -[font.bold_italic] -family = "OperatorMono" -style = "Medium Italic" - -[font.glyph_offset] -x = 0 -y = 0 - -[font.italic] -family = "SourceCodePro" -style = "Semibold Italic" - -[font.normal] -family = "SourceCodePro" -style = "Semibold" - -[font.offset] -x = -1 -y = 0 diff --git a/src/light-large.toml b/src/light-large.toml deleted file mode 100644 index e0fcab2..0000000 --- a/src/light-large.toml +++ /dev/null @@ -1,54 +0,0 @@ -[colors.bright] -black = "0xbcbcbc" -blue = "0xd75f00" -cyan = "0x005faf" -green = "0xd70087" -magenta = "0xd75f00" -red = "0xd70000" -white = "0x005f87" -yellow = "0x8700af" - -[colors.cursor] -cursor = "0x878787" -text = "0xeeeeee" - -[colors.normal] -black = "0xeeeeee" -blue = "0x0087af" -cyan = "0x005f87" -green = "0x008700" -magenta = "0x878787" -red = "0xaf0000" -white = "0x444444" -yellow = "0x5f8700" - -[colors.primary] -background = "0xeeeeee" -foreground = "0x878787" - -[font] -size = 13.0 - -[font.bold] -family = "SourceCodePro" -style = "Bold" - -[font.bold_italic] -family = "OperatorMono" -style = "Medium Italic" - -[font.glyph_offset] -x = 0 -y = 0 - -[font.italic] -family = "SourceCodePro" -style = "SemiBold Italic" - -[font.normal] -family = "SourceCodePro" -style = "SemiBold" - -[font.offset] -x = -1 -y = 0 diff --git a/src/light-small.toml b/src/light-small.toml deleted file mode 100644 index 6ace2d0..0000000 --- a/src/light-small.toml +++ /dev/null @@ -1,54 +0,0 @@ -[colors.bright] -black = "0xbcbcbc" -blue = "0xd75f00" -cyan = "0x005faf" -green = "0xd70087" -magenta = "0xd75f00" -red = "0xd70000" -white = "0x005f87" -yellow = "0x8700af" - -[colors.cursor] -cursor = "0x878787" -text = "0xeeeeee" - -[colors.normal] -black = "0xeeeeee" -blue = "0x0087af" -cyan = "0x005f87" -green = "0x008700" -magenta = "0x878787" -red = "0xaf0000" -white = "0x444444" -yellow = "0x5f8700" - -[colors.primary] -background = "0xeeeeee" -foreground = "0x878787" - -[font] -size = 9.0 - -[font.bold] -family = "SourceCodePro" -style = "Bold" - -[font.bold_italic] -family = "OperatorMono" -style = "Medium Italic" - -[font.glyph_offset] -x = 0 -y = 0 - -[font.italic] -family = "SourceCodePro" -style = "SemiBold Italic" - -[font.normal] -family = "SourceCodePro" -style = "SemiBold" - -[font.offset] -x = -1 -y = 0 diff --git a/src/light.toml b/src/light.toml index 7dc1e3d..aa82c0a 100644 --- a/src/light.toml +++ b/src/light.toml @@ -25,30 +25,3 @@ yellow = "0x5f8700" [colors.primary] background = "0xeeeeee" foreground = "0x878787" - -[font] -size = 11.0 - -[font.bold] -family = "SourceCodePro" -style = "Bold" - -[font.bold_italic] -family = "OperatorMono" -style = "Medium Italic" - -[font.glyph_offset] -x = 0 -y = 0 - -[font.italic] -family = "SourceCodePro" -style = "SemiBold Italic" - -[font.normal] -family = "SourceCodePro" -style = "SemiBold" - -[font.offset] -x = -1 -y = 0