diff --git a/lua/zenbones/build.lua b/lua/zenbones/build.lua index 749390d..e909be2 100644 --- a/lua/zenbones/build.lua +++ b/lua/zenbones/build.lua @@ -16,8 +16,26 @@ end local function build() local templates = { "vim", "kitty", "alacritty", "wezterm", "lualine", "lightline", "tmux" } for _, t in ipairs(templates) do - write_template(unpack(require("zenbones.build." .. t) "zenbones")) - write_template(unpack(require("zenbones.build." .. t) "zenflesh")) + write_template( + unpack( + require("zenbones.build." .. t)( + "zenbones", + require "zenbones", + require "zenbones.palette", + require "zenbones.terminal" + ) + ) + ) + write_template( + unpack( + require("zenbones.build." .. t)( + "zenflesh", + require "zenflesh", + require "zenflesh.palette", + require "zenflesh.terminal" + ) + ) + ) end end diff --git a/lua/zenbones/build/alacritty.lua b/lua/zenbones/build/alacritty.lua index 3037bc5..f5e2df2 100644 --- a/lua/zenbones/build/alacritty.lua +++ b/lua/zenbones/build/alacritty.lua @@ -26,10 +26,7 @@ colors: white: '${color15}' ]] -return function(name) - local theme = require(name) - local terminal = require(name .. ".terminal") - +return function(name, theme, palette, terminal) local values = { name = name, bg = theme.Normal.bg.hex, diff --git a/lua/zenbones/build/kitty.lua b/lua/zenbones/build/kitty.lua index 6e31674..02693ed 100644 --- a/lua/zenbones/build/kitty.lua +++ b/lua/zenbones/build/kitty.lua @@ -39,10 +39,7 @@ color14 ${color14} color15 ${color15} ]] -return function(name) - local theme = require(name) - local terminal = require(name .. ".terminal") - +return function(name, theme, palette, terminal) local bg = theme.Normal.bg.hex local fg = theme.Normal.fg.hex local values = { diff --git a/lua/zenbones/build/lightline.lua b/lua/zenbones/build/lightline.lua index f820515..686a775 100644 --- a/lua/zenbones/build/lightline.lua +++ b/lua/zenbones/build/lightline.lua @@ -22,9 +22,7 @@ let s:p.tabline.tabsel = [ [ "${tabsel_fg}", "${tabsel_bg}", "bold" ] ] let g:lightline#colorscheme#zenbones#palette = lightline#colorscheme#fill(s:p) ]] -return function(name) - local theme = require(name) - +return function(name, theme, palette, terminal) return { string.format("autoload/lightline/colorscheme/%s.vim", name), template, diff --git a/lua/zenbones/build/lualine.lua b/lua/zenbones/build/lualine.lua index 7d20559..d474e20 100644 --- a/lua/zenbones/build/lualine.lua +++ b/lua/zenbones/build/lualine.lua @@ -33,9 +33,7 @@ return { } ]] -return function(name) - local theme = require(name) - +return function(name, theme, palette, terminal) return { string.format("lua/lualine/themes/%s.lua", name), template, diff --git a/lua/zenbones/build/tmux.lua b/lua/zenbones/build/tmux.lua index 5374ce7..b45dd69 100644 --- a/lua/zenbones/build/tmux.lua +++ b/lua/zenbones/build/tmux.lua @@ -17,10 +17,7 @@ set -g clock-mode-colour '${color5}' set -g mode-style fg='${color0}',bg='${selection_background}' ]] -return function(name) - local theme = require(name) - local terminal = require(name .. ".terminal") - +return function(name, theme, palette, terminal) local values = { selection_background = theme.Visual.bg.hex, } diff --git a/lua/zenbones/build/vim.lua b/lua/zenbones/build/vim.lua index 86c4007..702e379 100644 --- a/lua/zenbones/build/vim.lua +++ b/lua/zenbones/build/vim.lua @@ -34,25 +34,23 @@ endif ${vimcolors} ]] -return function(name) - local theme = require(name) - local terminal = require(name .. ".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 +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") + -- 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, - }, - } + return { + string.format("colors/%s.vim", name), + template, + { + background = name == "zenbones" and "light" or "dark", + name = name, + termcolors = termcolors, + vimcolors = vimcolors, + }, + } end diff --git a/lua/zenbones/build/wezterm.lua b/lua/zenbones/build/wezterm.lua index a6ce30e..7686077 100644 --- a/lua/zenbones/build/wezterm.lua +++ b/lua/zenbones/build/wezterm.lua @@ -12,10 +12,7 @@ ansi = ["${color0}", "${color1}", "${color2}", "${color3}", "${color4}", "${colo brights = ["${color8}", "${color9}", "${color10}", "${color11}", "${color12}", "${color13}", "${color14}", "${color15}"] ]] -return function(name) - local theme = require(name) - local terminal = require(name .. ".terminal") - +return function(name, theme, palette, terminal) local name = name:sub(1, 1):upper() .. name:sub(2) local values = {