dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3a5af7d58719323a8afc32a7ea0df4487a623872
parent 69bf6a395654acae630e96cd6e188c462a85607a
Author: Alex Balgavy <alex@balgavy.eu>
Date:   Sun, 10 Nov 2024 19:40:06 +0100

alacritty: migrate to new version of config

Diffstat:
Aalacritty/alacritty.toml | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Dalacritty/alacritty.yml | 158-------------------------------------------------------------------------------
Dalacritty/macos-altfix.yml | 128-------------------------------------------------------------------------------
Aalacritty/theme-dark.toml | 27+++++++++++++++++++++++++++
Aalacritty/theme-light.toml | 27+++++++++++++++++++++++++++
Mscripts/set-theme | 15++++++++-------
6 files changed, 112 insertions(+), 293 deletions(-)

diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml @@ -0,0 +1,50 @@ +[cursor] +unfocused_hollow = true + +[font] +size = 12.0 + +[font.bold] +style = "Bold" + +[font.bold_italic] +style = "Bold Italic" + +[font.italic] +style = "Italic" + +[font.normal] +family = "MesloLGS NF" + +[[hints.enabled]] +regex = "(ipfs:|ipns:|magnet:|mailto:|gemini://|gopher://|https://|http://|news:|file:|git://|ssh:|ftp://)[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" +hyperlinks = true +mouse = { enabled = true, mods = "Command" } +post_processing = true +persist = false +command = "linkhandler" +binding = { key = "O", mods = "Command|Shift" } + +[window] +decorations = "buttonless" +dynamic_padding = true +dynamic_title = true +opacity = 0.85 +title = "Alacritty" +option_as_alt = "Both" + +[scrolling] +history = 10000 +multiplier = 3 + +[window.class] +general = "Alacritty" +instance = "Alacritty" + +[window.padding] +x = 5 +y = 5 + +[general] +live_config_reload = true +import = [ "./theme-light.toml"] diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml @@ -1,157 +0,0 @@ -# vim: expandtab shiftwidth=4 softtabstop=4 tabstop=8 -# ^ need this because the setbg script uses indentation to find color scheme definitions -# -# All imports must either be absolute paths starting with `/`, or paths relative -# to the user's home directory starting with `~/`. -import: - - ~/.config/alacritty/macos-altfix.yml - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. -window: - # Window opacity as a floating point number from `0.0` to `1.0`. - # The value `0.0` is completely transparent and `1.0` is opaque. - opacity: 0.85 - - # Window padding (changes require restart) - padding: - x: 5 - y: 5 - - # Spread additional padding evenly around the terminal content. - dynamic_padding: true - - decorations: buttonless - - # Window title - title: Alacritty - - # Allow terminal applications to change Alacritty's window title. - dynamic_title: true - - # Window class (Linux/BSD only): - class: - # Application instance name - instance: Alacritty - # General application class - general: Alacritty - -#scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - history: 10000 - - # Scrolling distance multiplier. - multiplier: 3 - -# Font configuration -font: - # Normal (roman) font face - normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux/BSD) monospace - # - (Windows) Consolas - family: MesloLGS NF - - # The `style` can be specified to pick a specific face. - - # Bold font face - bold: - style: Bold - - # Italic font face - italic: - style: Italic - - # Bold italic font face - bold_italic: - style: Bold Italic - - # Point size - size: 12.0 - - # Offset is the extra space around each character. `offset.y` can be thought - # of as modifying the line spacing, and `offset.x` as modifying the letter - # spacing. - #offset: - # x: 0 - # y: 0 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the - # right, increasing `y` moves the glyph upward. - #glyph_offset: - # x: 0 - # y: 0 - -cursor: - # If this is `true`, the cursor will be rendered as a hollow box when the - # window is not focused. - unfocused_hollow: true - -# Live config reload (changes require restart) -live_config_reload: true - -mouse: - hints: - launcher: - program: linkhandler - args: [] - modifiers: Command -schemes: - dark: &dark - primary: - background: '#090909' - foreground: '#cccdce' - cursor: - text: '#090909' - cursor: '#cccdce' - normal: - black: '#090909' - red: '#712F18' - green: '#747A85' - yellow: '#817F81' - blue: '#7A8692' - magenta: '#918E8E' - cyan: '#9E9EA0' - white: '#cccdce' - bright: - black: '#8e8f90' - red: '#A58F78' - green: '#747A85' - yellow: '#817F81' - blue: '#7A8692' - magenta: '#918E8E' - cyan: '#9E9EA0' - white: '#cccdce' - light: &light - primary: - background: '#f8f8f6' - foreground: '#102237' - cursor: - text: '#f8f8f6' - cursor: '#102237' - normal: - black: '#102237' - yellow: '#eb8d50' - green: '#94b45d' - red: '#e48f5e' - blue: '#174fd3' - magenta: '#2e5ce7' - cyan: '#f2d292' - white: '#102237' - bright: - black: '#7e7e75' - red: '#eb8d50' - green: '#f1cf84' - yellow: '#f1da85' - blue: '#174fd3' - magenta: '#2e5ce7' - cyan: '#f2d292' - white: '#102237' - -colors: *dark- \ No newline at end of file diff --git a/alacritty/macos-altfix.yml b/alacritty/macos-altfix.yml @@ -1,128 +0,0 @@ -key_bindings: - - { key: N, mods: Command, action: SpawnNewInstance } - - { key: PageUp, action: ScrollPageUp } - - { key: PageUp, mode: Alt, chars: "\x1B[5~" } - - { key: PageUp, mods: Shift, chars: "\x1B[5~" } - - { key: PageDown, action: ScrollPageDown } - - { key: PageDown, mode: Alt, chars: "\x1B[6~" } - - { key: PageDown, mods: Shift, chars: "\x1B[6~" } - - { key: Home, action: ScrollToTop } - - { key: Home, mode: Alt, chars: "\x1BOH" } - - { key: Home, mods: Shift, chars: "\x1B[H" } - - { key: End, action: ScrollToBottom } - - { key: End, mode: Alt, chars: "\x1BOF" } - - { key: End, mods: Shift, chars: "\x1B[F" } - - { key: Tab, mods: Alt, chars: "\x1B\t" } - - { key: Tab, mods: Alt|Shift, chars: "\x1B\x1B[Z" } - - { key: Back, chars: "\x7F" } - - { key: Back, mods: Alt, chars: "\x1B\x7F" } - - { key: Back, mods: Alt|Shift, chars: "\x1B\x08" } - - { key: Space, mods: Control, chars: "\x00" } - - { key: Space, mods: Alt, chars: "\x20" } - - { key: Left, mods: Alt, chars: "\x1Bb" } - - { key: Left, mods: Alt|Shift, chars: "\x1B\x1B[D" } - - { key: Right, mods: Alt, chars: "\x1Bf" } - - { key: Right, mods: Alt|Shift, chars: "\x1B\x1B[C" } - - { key: Down, mods: Alt, chars: "\x1B\x1B[B" } - - { key: Down, mods: Alt|Shift, chars: "\x1B\x1B[B" } - - { key: Up, mods: Alt, chars: "\x1B\x1B[A" } - - { key: Up, mods: Alt|Shift, chars: "\x1B\x1B[A" } - - { key: A, mods: Alt, chars: "\x1Ba" } - - { key: A, mods: Alt|Shift, chars: "\x1BA" } - - { key: B, mods: Alt, chars: "\x1Bb" } - - { key: B, mods: Alt|Shift, chars: "\x1BB" } - - { key: C, mods: Alt, chars: "\x1Bc" } - - { key: C, mods: Alt|Shift, chars: "\x1BC" } - - { key: D, mods: Alt, chars: "\x1Bd" } - - { key: D, mods: Alt|Shift, chars: "\x1BD" } - - { key: E, mods: Alt, chars: "\x1Be" } - - { key: E, mods: Alt|Shift, chars: "\x1BE" } - - { key: F, mods: Alt, chars: "\x1Bf" } - - { key: F, mods: Alt|Shift, chars: "\x1BF" } - - { key: G, mods: Alt, chars: "\x1Bg" } - - { key: G, mods: Alt|Shift, chars: "\x1BG" } - - { key: H, mods: Alt, chars: "\x1Bh" } - - { key: H, mods: Alt|Shift, chars: "\x1BH" } - - { key: I, mods: Alt, chars: "\x1Bi" } - - { key: I, mods: Alt|Shift, chars: "\x1BI" } - - { key: J, mods: Alt, chars: "\x1Bj" } - - { key: J, mods: Alt|Shift, chars: "\x1BJ" } - - { key: K, mods: Alt, chars: "\x1Bk" } - - { key: K, mods: Alt|Shift, chars: "\x1BK" } - - { key: L, mods: Alt, chars: "\x1Bl" } - - { key: L, mods: Alt|Shift, chars: "\x1BL" } - - { key: M, mods: Alt, chars: "\x1Bm" } - - { key: M, mods: Alt|Shift, chars: "\x1BM" } - - { key: N, mods: Alt, chars: "\x1Bn" } - - { key: N, mods: Alt|Shift, chars: "\x1BN" } - - { key: O, mods: Alt, chars: "\x1Bo" } - - { key: O, mods: Alt|Shift, chars: "\x1BO" } - - { key: P, mods: Alt, chars: "\x1Bp" } - - { key: P, mods: Alt|Shift, chars: "\x1BP" } - - { key: Q, mods: Alt, chars: "\x1Bq" } - - { key: Q, mods: Alt|Shift, chars: "\x1BQ" } - - { key: R, mods: Alt, chars: "\x1Br" } - - { key: R, mods: Alt|Shift, chars: "\x1BR" } - - { key: S, mods: Alt, chars: "\x1Bs" } - - { key: S, mods: Alt|Shift, chars: "\x1BS" } - - { key: T, mods: Alt, chars: "\x1Bt" } - - { key: T, mods: Alt|Shift, chars: "\x1BT" } - - { key: U, mods: Alt, chars: "\x1Bu" } - - { key: U, mods: Alt|Shift, chars: "\x1BU" } - - { key: V, mods: Alt, chars: "\x1Bv" } - - { key: V, mods: Alt|Shift, chars: "\x1BV" } - - { key: W, mods: Alt, chars: "\x1Bw" } - - { key: W, mods: Alt|Shift, chars: "\x1BW" } - - { key: X, mods: Alt, chars: "\x1Bx" } - - { key: X, mods: Alt|Shift, chars: "\x1BX" } - - { key: Y, mods: Alt, chars: "\x1By" } - - { key: Y, mods: Alt|Shift, chars: "\x1BY" } - - { key: Y, mods: Alt|Control, chars: "\x1B\x19" } - - { key: Z, mods: Alt, chars: "\x1Bz" } - - { key: Z, mods: Alt|Shift, chars: "\x1BZ" } - - { key: Key1, mods: Alt, chars: "\x1B1" } - - { key: Key1, mods: Alt|Shift, chars: "\x1B!" } - - { key: Key2, mods: Alt, chars: "\x1B2" } - - { key: Key2, mods: Alt|Shift, chars: "\x1B#" } - - { key: Key3, mods: Alt, chars: "\x1B3" } - - { key: Key3, mods: Alt|Shift, chars: "\x1B#" } - - { key: Key4, mods: Alt, chars: "\x1B4" } - - { key: Key4, mods: Alt|Shift, chars: "\x1B$" } - - { key: Key5, mods: Alt, chars: "\x1B5" } - - { key: Key5, mods: Alt|Shift, chars: "\x1B%" } - - { key: Key6, mods: Alt, chars: "\x1B6" } - - { key: Key6, mods: Alt|Shift, chars: "\x1B^" } - - { key: Key6, mods: Control, chars: "\x1e" } - - { key: Key7, mods: Alt, chars: "\x1B7" } - - { key: Key7, mods: Alt|Shift, chars: "\x1B&" } - - { key: Key8, mods: Alt, chars: "\x1B8" } - - { key: Key8, mods: Alt|Shift, chars: "\x1B*" } - - { key: Key9, mods: Alt, chars: "\x1B9" } - - { key: Key9, mods: Alt|Shift, chars: "\x1B(" } - - { key: Key0, mods: Alt, chars: "\x1B0" } - - { key: Key0, mods: Alt|Shift, chars: "\x1B)" } - - { key: Minus, mods: Alt, chars: "\x1B-" } - - { key: Minus, mods: Alt|Shift, chars: "\x1B_" } - - { key: Equals, mods: Alt, chars: "\x1B=" } - - { key: Equals, mods: Alt|Shift, chars: "\x1B+" } - - { key: LBracket, mods: Alt, chars: "\x1B[" } - - { key: LBracket, mods: Alt|Shift, chars: "\x1B{" } - - { key: RBracket, mods: Alt, chars: "\x1B]" } - - { key: RBracket, mods: Alt|Shift, chars: "\x1B}" } - - { key: RBracket, mods: Alt|Control, chars: "\x1B\x1D" } - - { key: Backslash, mods: Alt, chars: "\x1B\\" } - - { key: Backslash, mods: Alt|Shift, chars: "\x1B|" } - - { key: Semicolon, mods: Alt, chars: "\x1B;" } - - { key: Semicolon, mods: Alt|Shift, chars: "\x1B:" } - - { key: Apostrophe, mods: Alt, chars: "\x1B'" } - - { key: Apostrophe, mods: Alt|Shift, chars: "\x1B\"" } - - { key: Comma, mods: Alt, chars: "\x1B," } - - { key: Comma, mods: Alt|Shift, chars: "\x1B<" } - - { key: Period, mods: Alt, chars: "\x1B." } - - { key: Period, mods: Alt|Shift, chars: "\x1B>" } - - { key: Slash, mods: Alt, chars: "\x1B/" } - - { key: Slash, mods: Alt|Shift, chars: "\x1B?" } - - { key: Slash, mods: Control, chars: "\x1f" } - - { key: Grave, mods: Alt, chars: "\x1B`" } - - { key: Grave, mods: Alt|Shift, chars: "\x1B~" } - diff --git a/alacritty/theme-dark.toml b/alacritty/theme-dark.toml @@ -0,0 +1,27 @@ +[colors.bright] +black = "#8e8f90" +blue = "#7A8692" +cyan = "#9E9EA0" +green = "#747A85" +magenta = "#918E8E" +red = "#A58F78" +white = "#cccdce" +yellow = "#817F81" + +[colors.cursor] +cursor = "#cccdce" +text = "#090909" + +[colors.normal] +black = "#090909" +blue = "#7A8692" +cyan = "#9E9EA0" +green = "#747A85" +magenta = "#918E8E" +red = "#712F18" +white = "#cccdce" +yellow = "#817F81" + +[colors.primary] +background = "#090909" +foreground = "#cccdce" diff --git a/alacritty/theme-light.toml b/alacritty/theme-light.toml @@ -0,0 +1,27 @@ +[colors.bright] +black = "#918a84" +blue = "#e4a880" +cyan = "#d1b18e" +green = "#e09954" +magenta = "#c4a076" +red = "#278ce7" +white = "#152A3B" +yellow = "#83f199" + +[colors.cursor] +cursor = "#152A3B" +text = "#fdfbf9" + +[colors.normal] +black = "#152A3B" +blue = "#d89f79" +cyan = "#d1b18e" +green = "#eca259" +magenta = "#dab284" +red = "#278ce7" +white = "#152A3B" +yellow = "#83f199" + +[colors.primary] +background = "#fdfbf9" +foreground = "#152A3B" diff --git a/scripts/set-theme b/scripts/set-theme @@ -65,22 +65,23 @@ set_emacs() { # Change the 'colors' setting in the Alacritty config alacritty_change_theme() { + set -x # Look up the config file - DEFAULT_MACOS_CONFIG="$HOME"/.config/alacritty/alacritty.yml + DEFAULT_MACOS_CONFIG="$HOME"/.config/alacritty/alacritty.toml CFG="$DEFAULT_MACOS_CONFIG" [ -L "$DEFAULT_MACOS_CONFIG" ] && { printf "Following symlink to config...\n" - CFG=$($READLINK -f "$DEFAULT_MACOS_CONFIG") - } + CFG=$($READLINK -f "$DEFAULT_MACOS_CONFIG") + } # Replace 'colors: ...' with 'colors: *(dark|light)' depending on theme tmpfile=$(mktemp) trap 'rm $tmpfile' INT TERM EXIT - sed "/^colors: /c\\ -colors: *${1}" "$CFG" > "$tmpfile" \ - && cat "$tmpfile" > "$CFG" \ - && rm "$tmpfile" + sed "s/theme-[a-z]*.toml/theme-${1}.toml/" "$CFG" >"$tmpfile" && + cat "$tmpfile" >"$CFG" && + rm "$tmpfile" trap - INT TERM EXIT + set +x } set_terminal_and_wallpaper() {