fix: improved extra generation (fixes some wrong color)
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
package.path = "./lua/?/init.lua;./lua/?.lua"
|
||||
|
||||
local config = require("tokyonight.config").options
|
||||
local M = {}
|
||||
|
||||
local function write(str, fileName)
|
||||
print("[write] extra/" .. fileName)
|
||||
@@ -9,33 +7,40 @@ local function write(str, fileName)
|
||||
file:close()
|
||||
end
|
||||
|
||||
-- map of plugin name to plugin extension
|
||||
local extras = {
|
||||
kitty = "conf",
|
||||
fish = "fish",
|
||||
alacritty = "yml",
|
||||
wezterm = "toml",
|
||||
tmux = "tmux",
|
||||
xresources = "Xresources",
|
||||
xfceterm = "theme",
|
||||
foot = "ini",
|
||||
tilix = "json",
|
||||
}
|
||||
-- map of style to style name
|
||||
local styles = {
|
||||
storm = " Storm",
|
||||
night = "",
|
||||
day = " Day",
|
||||
}
|
||||
function M.setup()
|
||||
local config = require("tokyonight.config")
|
||||
vim.o.background = "dark"
|
||||
|
||||
for extra, ext in pairs(extras) do
|
||||
local plugin = require("tokyonight.extra." .. extra)
|
||||
for style, style_name in pairs(styles) do
|
||||
config.style = style
|
||||
local colors = require("tokyonight.colors").setup({ transform = true })
|
||||
local fname = extra .. "_tokyonight_" .. style .. "." .. ext
|
||||
colors["_upstream_url"] = "https://github.com/folke/tokyonight.nvim/raw/main/extras/" .. fname
|
||||
colors["_style_name"] = "Tokyo Night" .. style_name
|
||||
write(plugin.generate(colors), fname)
|
||||
-- map of plugin name to plugin extension
|
||||
local extras = {
|
||||
kitty = "conf",
|
||||
fish = "fish",
|
||||
alacritty = "yml",
|
||||
wezterm = "toml",
|
||||
tmux = "tmux",
|
||||
xresources = "Xresources",
|
||||
xfceterm = "theme",
|
||||
foot = "ini",
|
||||
tilix = "json",
|
||||
}
|
||||
-- map of style to style name
|
||||
local styles = {
|
||||
storm = " Storm",
|
||||
night = "",
|
||||
day = " Day",
|
||||
}
|
||||
|
||||
for extra, ext in pairs(extras) do
|
||||
local plugin = require("tokyonight.extra." .. extra)
|
||||
for style, style_name in pairs(styles) do
|
||||
config.setup({ style = style })
|
||||
local colors = require("tokyonight.colors").setup({ transform = true })
|
||||
local fname = extra .. "_tokyonight_" .. style .. "." .. ext
|
||||
colors["_upstream_url"] = "https://github.com/folke/tokyonight.nvim/raw/main/extras/" .. fname
|
||||
colors["_style_name"] = "Tokyo Night" .. style_name
|
||||
write(plugin.generate(colors), fname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user