2024-02-08 13:00:57 +00:00
|
|
|
local helpers = require "shipwright.transform.helpers"
|
2024-02-08 08:00:41 -05:00
|
|
|
|
|
|
|
|
local base_template = [[
|
|
|
|
|
[colors.bright]
|
|
|
|
|
black = "$bright_black"
|
|
|
|
|
red = "$bright_red"
|
|
|
|
|
green = "$bright_green"
|
|
|
|
|
yellow = "$bright_yellow"
|
|
|
|
|
blue = "$bright_blue"
|
|
|
|
|
magenta = "$bright_magenta"
|
|
|
|
|
cyan = "$bright_cyan"
|
|
|
|
|
white = "$bright_white"
|
|
|
|
|
|
|
|
|
|
[colors.cursor]
|
|
|
|
|
cursor = "$cursor_bg"
|
|
|
|
|
text = "$cursor_fg"
|
|
|
|
|
|
|
|
|
|
[colors.normal]
|
|
|
|
|
black = "$black"
|
|
|
|
|
blue = "$blue"
|
|
|
|
|
cyan = "$cyan"
|
|
|
|
|
green = "$green"
|
|
|
|
|
magenta = "$magenta"
|
|
|
|
|
red = "$red"
|
|
|
|
|
white = "$white"
|
|
|
|
|
yellow = "$yellow"
|
|
|
|
|
|
|
|
|
|
[colors.primary]
|
|
|
|
|
background = "$bg"
|
|
|
|
|
foreground = "$fg"]]
|
|
|
|
|
|
|
|
|
|
local function alacritty_toml(colors)
|
|
|
|
|
local text = helpers.apply_template(base_template, colors)
|
|
|
|
|
|
|
|
|
|
return helpers.split_newlines(text)
|
|
|
|
|
end
|
|
|
|
|
|
2021-11-07 08:16:33 +08:00
|
|
|
---@diagnostic disable: undefined-global
|
2021-11-06 12:04:23 +08:00
|
|
|
-- selene: allow(undefined_variable)
|
2021-11-05 14:43:28 +08:00
|
|
|
run(
|
|
|
|
|
{ specs, p, term },
|
|
|
|
|
transform.colorscheme_to_term_colors,
|
2024-02-08 08:00:41 -05:00
|
|
|
alacritty_toml,
|
2021-11-06 06:20:30 +00:00
|
|
|
{ prepend, "# This file is auto-generated by shipwright.nvim" },
|
2024-02-08 08:00:41 -05:00
|
|
|
{ overwrite, string.format("extras/alacritty/%s.toml", name) }
|
2021-11-05 14:43:28 +08:00
|
|
|
)
|
2021-11-06 12:04:23 +08:00
|
|
|
-- selene: deny(undefined_variable)
|
2021-11-07 08:16:33 +08:00
|
|
|
---@diagnostic enable: undefined-global
|