From 3ac5e92e3757223ef9f31ca7e430d35057588c09 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 20 Apr 2021 14:47:35 +0200 Subject: [PATCH] added alacritty configs --- README.md | 6 +-- extras/alacritty_tokyonight_night.yml | 34 +++++++++++++++++ extras/alacritty_tokyonight_storm.yml | 34 +++++++++++++++++ lua/tokyonight/extra/alacritty.lua | 54 +++++++++++++++++++++++++++ lua/tokyonight/extra/init.lua | 4 ++ 5 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 extras/alacritty_tokyonight_night.yml create mode 100644 extras/alacritty_tokyonight_storm.yml create mode 100644 lua/tokyonight/extra/alacritty.lua diff --git a/README.md b/README.md index 80ebea6..5d18514 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ A dark Neovim theme written in Lua ported from the Visual Studio Code [TokyoNigh + minimal inactive statusline + vim terminal colors + darker background for sidebar-like windows -+ color configs for [Kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include) -+ color configs for [Fish Shell](https://fishshell.com/) ++ color configs for [Kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include), [Alacritty](https://github.com/alacritty/alacritty) and [Fish Shell](https://fishshell.com/) + **lualine** theme ### Plugin Support @@ -107,7 +106,6 @@ let g:tokyonight_sidebars = [ "quickfix", "__vista__", "terminal" ] ## 🍭 Extras -Two color configs for **Kitty** and **Fish** can be found in [extras](extras/). To use them, refer to their respective documentation. +Extra color configs for **Kitty**, **Alacritty** and **Fish** can be found in [extras](extras/). To use them, refer to their respective documentation. ![image](https://user-images.githubusercontent.com/292349/115395546-d8d6f880-a198-11eb-98fb-a1194787701d.png) - diff --git a/extras/alacritty_tokyonight_night.yml b/extras/alacritty_tokyonight_night.yml new file mode 100644 index 0000000..ad1d8f6 --- /dev/null +++ b/extras/alacritty_tokyonight_night.yml @@ -0,0 +1,34 @@ +# TokyoNight Alacritty Colors +colors: + # Default colors + primary: + background: '0x1a1b26' + foreground: '0xc0caf5' + + # Normal colors + normal: + black: '0x15161E' + red: '0xf7768e' + green: '0x9ece6a' + yellow: '0xe0af68' + blue: '0x7aa2f7' + magenta: '0xbb9af7' + cyan: '0x7dcfff' + white: '0xa9b1d6' + + # Bright colors + bright: + black: '0x15161E' + red: '0xf7768e' + green: '0x9ece6a' + yellow: '0xe0af68' + blue: '0x7aa2f7' + magenta: '0xbb9af7' + cyan: '0x7dcfff' + white: '0xc0caf5' + + indexed_colors: + - { index: 16, color: '0xff9e64' } + - { index: 17, color: '0xdb4b4b' } + + \ No newline at end of file diff --git a/extras/alacritty_tokyonight_storm.yml b/extras/alacritty_tokyonight_storm.yml new file mode 100644 index 0000000..bb97b29 --- /dev/null +++ b/extras/alacritty_tokyonight_storm.yml @@ -0,0 +1,34 @@ +# TokyoNight Alacritty Colors +colors: + # Default colors + primary: + background: '0x24283b' + foreground: '0xc0caf5' + + # Normal colors + normal: + black: '0x1D202F' + red: '0xf7768e' + green: '0x9ece6a' + yellow: '0xe0af68' + blue: '0x7aa2f7' + magenta: '0xbb9af7' + cyan: '0x7dcfff' + white: '0xa9b1d6' + + # Bright colors + bright: + black: '0x1D202F' + red: '0xf7768e' + green: '0x9ece6a' + yellow: '0xe0af68' + blue: '0x7aa2f7' + magenta: '0xbb9af7' + cyan: '0x7dcfff' + white: '0xc0caf5' + + indexed_colors: + - { index: 16, color: '0xff9e64' } + - { index: 17, color: '0xdb4b4b' } + + \ No newline at end of file diff --git a/lua/tokyonight/extra/alacritty.lua b/lua/tokyonight/extra/alacritty.lua new file mode 100644 index 0000000..0d0d201 --- /dev/null +++ b/lua/tokyonight/extra/alacritty.lua @@ -0,0 +1,54 @@ +local util = require("tokyonight.util") + +local M = {} + +function M.alacritty(config) + config = config or require("tokyonight.config") + local colors = require("tokyonight.colors").setup(config) + + local alacrittyColors = {} + for k, v in pairs(colors) do + if type(v) == "string" then alacrittyColors[k] = v:gsub("^#", "0x") end + end + + local alacritty = util.template([[ +# TokyoNight Alacritty Colors +colors: + # Default colors + primary: + background: '${bg}' + foreground: '${fg}' + + # Normal colors + normal: + black: '${black}' + red: '${red}' + green: '${green}' + yellow: '${yellow}' + blue: '${blue}' + magenta: '${magenta}' + cyan: '${cyan}' + white: '${fg_dark}' + + # Bright colors + bright: + black: '${black}' + red: '${red}' + green: '${green}' + yellow: '${yellow}' + blue: '${blue}' + magenta: '${magenta}' + cyan: '${cyan}' + white: '${fg}' + + indexed_colors: + - { index: 16, color: '${orange}' } + - { index: 17, color: '${red1}' } + + ]], alacrittyColors) + + return alacritty +end + +return M + diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index 67c62f0..c9ca13a 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -3,6 +3,7 @@ package.path = "./lua/?/init.lua;./lua/?.lua" local config = require("tokyonight.config") local kitty = require("tokyonight.extra.kitty") local fish = require("tokyonight.extra.fish") +local alacritty = require("tokyonight.extra.alacritty") local function write(str, fileName) print("[write] extra/" .. fileName) @@ -15,8 +16,11 @@ config.style = "storm" write(kitty.kitty(config), "kitty_tokyonight_storm.conf") write(fish.fish(config), "fish_tokyonight_storm.fish") +write(alacritty.alacritty(config), "alacritty_tokyonight_storm.yml") config.style = "night" write(kitty.kitty(config), "kitty_tokyonight_night.conf") write(fish.fish(config), "fish_tokyonight_night.fish") +write(alacritty.alacritty(config), "alacritty_tokyonight_night.yml") +