From 6c66988950f4dc1327735463ae95514499994d79 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 27 Dec 2023 19:56:33 -0500 Subject: [PATCH] Migrate alacritty config to toml --- .config/alacritty/alacritty.toml | 91 ++++++++++++++++++++++++++++++++ .config/alacritty/alacritty.yml | 72 ------------------------- .config/alacritty/swapColors.sh | 8 +-- 3 files changed, 95 insertions(+), 76 deletions(-) create mode 100644 .config/alacritty/alacritty.toml delete mode 100644 .config/alacritty/alacritty.yml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..9f11a10 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,91 @@ +[colors.bright] +black = "0x555753" +blue = "0x739fcf" +cyan = "0x34e2e2" +green = "0x8ae234" +magenta = "0xad7fa8" +red = "0xef2929" +white = "0xeeeeec" +yellow = "0xfce94f" + +[colors.normal] +black = "0x2e3436" +blue = "0x3465a4" +cyan = "0x06989a" +green = "0x4e9a06" +magenta = "0x75507b" +red = "0xcc0000" +white = "0xd3d7cf" +yellow = "0xc4a000" + +[colors.primary] +background = "0x111111" +foreground = "0xb98000" + +[env] +WINIT_X11_SCALE_FACTOR = "1.0" + +[font] +size = 11.0 + +[font.normal] +family = "Hack" + +[[hints.enabled]] +command = "xdg-open" +hyperlinks = true +post_processing = true +regex = "(magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" + +[hints.enabled.binding] +key = "U" +mods = "Control|Shift" + +[hints.enabled.mouse] +enabled = true +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "Paste" +key = "V" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "Copy" +key = "C" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "SpawnNewInstance" +key = "Return" +mods = "Super" + +[[keyboard.bindings]] +key = "Backslash" +mods = "Super" + +[keyboard.bindings.command] +args = ["-c", "~/.config/alacritty/swapColors.sh"] +program = "sh" + +[mouse] +hide_when_typing = true + +[window.padding] +x = 2 +y = 2 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index acd5c73..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,72 +0,0 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator - -# Set environment variables -env: - # don't do DPI scaling, it sucks - WINIT_X11_SCALE_FACTOR: '1.0' - -window: - padding: {x: 2, y: 2} - -font: - normal: { family: Hack } - size: 11.0 - -colors: - primary: - background: '0x111111' - foreground: '0xb98000' - normal: - black: '0x2e3436' - red: '0xcc0000' - green: '0x4e9a06' - yellow: '0xc4a000' - blue: '0x3465a4' - magenta: '0x75507b' - cyan: '0x06989a' - white: '0xd3d7cf' - bright: - black: '0x555753' - red: '0xef2929' - green: '0x8ae234' - yellow: '0xfce94f' - blue: '0x739fcf' - magenta: '0xad7fa8' - cyan: '0x34e2e2' - white: '0xeeeeec' - -mouse: - hide_when_typing: true - -hints: - enabled: - - regex: "(magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\x00-\x1F\x7F-\x9F<>\"\\s{-}\\^⟨⟩`]+" - hyperlinks: true - command: xdg-open - post_processing: true - mouse: - enabled: true - mods: Control|Shift - binding: - key: U - mods: Control|Shift - -key_bindings: - # Copy/Paste - - { key: V, mods: Control|Shift, action: Paste } - - { key: C, mods: Control|Shift, action: Copy } - - # font sizing - - { key: Key0, mods: Control|Shift, action: ResetFontSize } - - { key: Equals, mods: Control|Shift, action: IncreaseFontSize } - - { key: Minus, mods: Control|Shift, action: DecreaseFontSize } - - # new instance in cwd - - { key: Return, mods: Super, action: SpawnNewInstance } - - # toggle font colors - - key: Backslash - mods: Super - command: {program: "sh", args: ["-c", "~/.config/alacritty/swapColors.sh"]} - diff --git a/.config/alacritty/swapColors.sh b/.config/alacritty/swapColors.sh index 239623c..7ff38ea 100755 --- a/.config/alacritty/swapColors.sh +++ b/.config/alacritty/swapColors.sh @@ -1,10 +1,10 @@ #!/bin/bash -file="$(dirname $0)/alacritty.yml" +file="$(dirname $0)/alacritty.toml" -prefix=' foreground: ' -amber="'0xb98000'" -green="'0x008000'" +prefix='foreground = ' +amber='"0xb98000"' +green='"0x008000"' color=$amber if [ -n "$1" ]