rename build/ -> template

This commit is contained in:
Michael Chris Lopez
2021-09-21 20:55:53 +08:00
parent 77a82cefca
commit 922eb2de63
23 changed files with 43 additions and 51 deletions

View File

@@ -0,0 +1,41 @@
local template = [[# This file is auto-generated from lua/zenbones/template/alacritty.lua
# ${name} alacritty colors
colors:
# Default colors
primary:
background: '${bg}'
foreground: '${fg}'
# Normal colors
normal:
black: '${color0}'
red: '${color1}'
green: '${color2}'
yellow: '${color3}'
blue: '${color4}'
magenta: '${color5}'
cyan: '${color6}'
white: '${color7}'
# Bright colors
bright:
black: '${color8}'
red: '${color9}'
green: '${color10}'
yellow: '${color11}'
blue: '${color12}'
magenta: '${color13}'
cyan: '${color14}'
white: '${color15}'
]]
return function(name, theme, palette, terminal)
local values = {
name = name,
bg = theme.Normal.bg.hex,
fg = theme.Normal.fg.hex,
}
for i, v in ipairs(terminal.colors) do
values["color" .. (i - 1)] = v.hex
end
return { string.format("extras/alacritty/%s.yml", name), template, values }
end

View File

@@ -0,0 +1,64 @@
local template = [[# This file is auto-generated from lua/zenbones/template/kitty.lua
# vim:ft=kitty
## name: ${name}
## license: MIT
## author: Michael Chris Lopez
## upstream: https://github.com/mcchrish/zenbones.nvim/raw/main/extras/kitty/${name}.conf
background ${background}
foreground ${foreground}
selection_background ${selection_background}
selection_foreground ${selection_foreground}
url_color ${url_color}
cursor ${cursor}
# Tabs
active_tab_background ${active_tab_background}
active_tab_foreground ${active_tab_foreground}
inactive_tab_background ${inactive_tab_background}
inactive_tab_foreground ${inactive_tab_foreground}
#tab_bar_background ${tab_bar_background}
# normal
color0 ${color0}
color1 ${color1}
color2 ${color2}
color3 ${color3}
color4 ${color4}
color5 ${color5}
color6 ${color6}
color7 ${color7}
# bright
color8 ${color8}
color9 ${color9}
color10 ${color10}
color11 ${color11}
color12 ${color12}
color13 ${color13}
color14 ${color14}
color15 ${color15}
]]
return function(name, theme, palette, terminal)
local bg = theme.Normal.bg.hex
local fg = theme.Normal.fg.hex
local values = {
name = name,
background = bg,
foreground = fg,
selection_background = theme.Visual.bg.hex,
selection_foreground = fg,
url_color = terminal.colors[13].hex,
cursor = fg,
active_tab_background = theme.Search.bg.hex,
active_tab_foreground = fg,
inactive_tab_background = theme.StatusLine.bg.hex,
inactive_tab_foreground = fg,
}
for i, v in ipairs(terminal.colors) do
values["color" .. (i - 1)] = v.hex
end
return { string.format("extras/kitty/%s.conf", name), template, values }
end

View File

@@ -0,0 +1,53 @@
local template = [[" This file is auto-generated from lua/zenbones/template/lightline.lua
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ "${common_fg}", "${normal_a_bg}", "bold" ], [ "${common_fg}", "${normal_b_bg}" ] ]
let s:p.normal.middle = [ [ "${normal_c_fg}", "${normal_c_bg}" ] ]
let s:p.normal.right = [ [ "${common_fg}", "${normal_b_bg}" ], [ "${common_fg}", "${normal_b_bg}" ] ]
let s:p.normal.warning = [ [ "${warning_fg}", "${warning_bg}" ] ]
let s:p.normal.error = [ [ "${error_fg}", "${error_bg}" ] ]
let s:p.inactive.left = [ [ "${inactive_fg}", "${inactive_bg}" ], [ "${inactive_fg}", "${inactive_bg}" ] ]
let s:p.inactive.middle = [ [ "${inactive_fg}", "${inactive_bg}" ] ]
let s:p.inactive.right = [ [ "${inactive_fg}", "${inactive_bg}" ] ]
let s:p.insert.left = [ [ "${common_fg}", "${insert_a_bg}", "bold" ], [ "${common_fg}", "${normal_b_bg}" ] ]
let s:p.replace.left = [ [ "${common_fg}", "${replace_a_bg}", "bold" ], [ "${common_fg}", "${normal_b_bg}" ] ]
let s:p.visual.left = [ [ "${common_fg}", "${visual_a_bg}", "bold" ], [ "${common_fg}", "${normal_b_bg}" ] ]
let s:p.tabline.left = [ [ "${tabline_left_fg}", "${tabline_left_bg}", "italic" ] ]
let s:p.tabline.middle = [ [ "${inactive_fg}", "${inactive_bg}" ] ]
let s:p.tabline.right = [ [ "${tabline_right_fg}", "${tabline_right_bg}" ] ]
let s:p.tabline.tabsel = [ [ "${tabsel_fg}", "${tabsel_bg}", "bold" ] ]
let g:lightline#colorscheme#zenbones#palette = lightline#colorscheme#fill(s:p)
]]
return function(name, theme, palette, terminal)
return {
string.format("autoload/lightline/colorscheme/%s.vim", name),
template,
{
common_fg = theme.Folded.fg.hex,
inactive_bg = theme.StatusLineNC.bg.hex,
inactive_fg = theme.StatusLineNC.fg.hex,
normal_a_bg = theme.PmenuSbar.bg.hex,
normal_b_bg = theme.PmenuSel.bg.hex,
normal_c_bg = theme.StatusLine.bg.hex,
normal_c_fg = theme.StatusLine.fg.hex,
insert_a_bg = theme.DiffText.bg.hex,
visual_a_bg = theme.Visual.bg.hex,
replace_a_bg = theme.DiffDelete.bg.hex,
tabline_left_bg = theme.PmenuSel.bg.hex,
tabline_left_fg = theme.Normal.fg.hex,
tabline_right_bg = theme.PmenuSel.bg.hex,
tabline_right_fg = theme.Normal.fg.hex,
tabsel_bg = theme.Normal.bg.hex,
tabsel_fg = theme.Normal.fg.hex,
warning_bg = theme.LspDiagnosticsVirtualTextWarning.bg.hex,
warning_fg = theme.LspDiagnosticsVirtualTextWarning.fg.hex,
error_bg = theme.LspDiagnosticsVirtualTextError.bg.hex,
error_fg = theme.LspDiagnosticsVirtualTextError.fg.hex,
},
}
end

View File

@@ -0,0 +1,55 @@
local template = [[-- This file is auto-generated from lua/zenbones/template/lualine.lua
local common_fg = "${common_fg}"
local inactive_bg = "${inactive_bg}"
local inactive_fg = "${inactive_fg}"
return {
normal = {
a = { bg = "${normal_a_bg}", fg = common_fg, gui = "bold" },
b = { bg = "${normal_b_bg}", fg = common_fg },
c = { bg = "${normal_c_bg}", fg = "${normal_c_fg}" },
},
insert = {
a = { bg = "${insert_a_bg}", fg = common_fg, gui = "bold" },
},
command = {
a = { bg = "${command_a_bg}", fg = common_fg, gui = "bold" },
},
visual = {
a = { bg = "${visual_a_bg}", fg = common_fg, gui = "bold" },
},
replace = {
a = { bg = "${replace_a_bg}", fg = common_fg, gui = "bold" },
},
inactive = {
a = { bg = inactive_bg, fg = inactive_fg, gui = "bold" },
b = { bg = inactive_bg, fg = inactive_fg },
c = { bg = inactive_bg, fg = inactive_fg },
},
}
]]
return function(name, theme, palette, terminal)
return {
string.format("lua/lualine/themes/%s.lua", name),
template,
{
common_fg = theme.Folded.fg.hex,
inactive_bg = theme.StatusLineNC.bg.hex,
inactive_fg = theme.StatusLineNC.fg.hex,
normal_a_bg = theme.PmenuSbar.bg.hex,
normal_b_bg = theme.PmenuSel.bg.hex,
normal_c_bg = theme.StatusLine.bg.hex,
normal_c_fg = theme.StatusLine.fg.hex,
insert_a_bg = theme.DiffText.bg.hex,
command_a_bg = theme.Search.bg.hex,
visual_a_bg = theme.Visual.bg.hex,
replace_a_bg = theme.DiffDelete.bg.hex,
},
}
end

View File

@@ -0,0 +1,30 @@
local template = [[# This file is auto-generated from lua/zenbones/template/tmux.lua
set -g status-left ' #[fg=${color5},bold]#{s/root//:client_key_table} '
set -g status-right '#[fg=${color5},bold] [#S]#[fg=${color5},bold] [%d/%m] #[fg=${color5},bold][%I:%M%p] '
set -g status-style fg='${color5}',bg='${color7}'
set -g window-status-current-style fg='${color5}',bg='${color7}',bold
set -g pane-border-style fg='${color5}'
set -g pane-active-border-style fg='${color5}'
set -g message-style fg='${color0}',bg='${selection_background}'
set -g display-panes-active-colour '${color5}'
set -g display-panes-colour '${color5}'
set -g clock-mode-colour '${color5}'
set -g mode-style fg='${color0}',bg='${selection_background}'
]]
return function(name, theme, palette, terminal)
local values = {
selection_background = theme.Visual.bg.hex,
}
for i, v in ipairs(terminal.colors) do
values["color" .. (i - 1)] = v.hex
end
return { string.format("extras/tmux/%s.tmux", name), template, values }
end

View File

@@ -0,0 +1,56 @@
local template = [[" This file is auto-generated from lua/zenbones/template/vim.lua
if exists('g:colors_name')
highlight clear
syntax reset
set t_Co=256
endif
set background=${background}
let g:colors_name = '${name}'
${termcolors}
if has('terminal')
let g:terminal_ansi_colors = [
\ g:terminal_color_0,
\ g:terminal_color_1,
\ g:terminal_color_2,
\ g:terminal_color_3,
\ g:terminal_color_4,
\ g:terminal_color_5,
\ g:terminal_color_6,
\ g:terminal_color_7,
\ g:terminal_color_8,
\ g:terminal_color_9,
\ g:terminal_color_10,
\ g:terminal_color_11,
\ g:terminal_color_12,
\ g:terminal_color_13,
\ g:terminal_color_14,
\ g:terminal_color_15
\ ]
endif
${vimcolors}
]]
local lush = require "lush"
return function(name, theme, palette, terminal)
local termcolors = ""
for i, v in ipairs(terminal.colors) do
termcolors = termcolors .. string.format("let g:terminal_color_%s = '%s'\n", (i - 1), v.hex)
end
-- Compile lush table, concatenate to a single string, and remove blend property
local vimcolors = table.concat(vim.fn.sort(lush.compile(theme, { exclude_keys = { "blend" } })), "\n")
return {
string.format("colors/%s.vim", name),
template,
{
background = name == "zenbones" and "light" or "dark",
name = name,
termcolors = termcolors,
vimcolors = vimcolors,
},
}
end

View File

@@ -0,0 +1,34 @@
local template = [[# This file is auto-generated from lua/zenbones/template/wezterm.lua
# ${name}
[colors]
foreground = "${fg}"
background = "${bg}"
cursor_bg = "${cursor_bg}"
cursor_border = "${cursor_border}"
cursor_fg = "${cursor_fg}"
selection_bg = "${selection_bg}"
selection_fg = "${selection_fg}"
ansi = ["${color0}", "${color1}", "${color2}", "${color3}", "${color4}", "${color5}", "${color6}", "${color7}"]
brights = ["${color8}", "${color9}", "${color10}", "${color11}", "${color12}", "${color13}", "${color14}", "${color15}"]
]]
return function(name, theme, palette, terminal)
local name = name:sub(1, 1):upper() .. name:sub(2)
local values = {
name = name,
fg = theme.Normal.fg.hex,
bg = theme.Normal.bg.hex,
cursor_bg = theme.Cursor.bg.hex,
cursor_border = theme.Cursor.fg.hex,
cursor_fg = theme.Cursor.fg.hex,
selection_bg = theme.Visual.bg.hex,
selection_fg = theme.Normal.fg.hex,
}
for i, v in ipairs(terminal.colors) do
values["color" .. (i - 1)] = v.hex
end
return { string.format("extras/wezterm/%s.toml", name), template, values }
end