farout.nvim/lua/tokyonight/extra/init.lua

51 lines
1.3 KiB
Lua
Raw Normal View History

local M = {}
2021-04-20 12:24:44 +00:00
local function write(str, fileName)
2022-09-05 10:06:20 +00:00
print("[write] extra/" .. fileName)
vim.fn.mkdir(vim.fs.dirname("extras/" .. fileName), "p")
2022-09-05 10:06:20 +00:00
local file = io.open("extras/" .. fileName, "w")
file:write(str)
file:close()
2021-04-20 12:24:44 +00:00
end
function M.setup()
local config = require("tokyonight.config")
vim.o.background = "dark"
-- 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",
iterm = "itermcolors",
lua = "lua",
}
-- map of style to style name
local styles = {
storm = " Storm",
night = "",
day = " Day",
moon = " Moon",
}
2021-04-20 12:24:44 +00:00
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
2022-09-05 10:06:20 +00:00
end
2021-05-21 12:51:45 +00:00
end
return M