2022-09-05 14:17:10 +00:00
|
|
|
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)
|
2022-09-18 21:51:39 +00:00
|
|
|
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
|
|
|
|
|
2022-09-05 14:17:10 +00:00
|
|
|
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",
|
2022-09-07 20:36:18 +00:00
|
|
|
iterm = "itermcolors",
|
2022-09-12 07:07:57 +00:00
|
|
|
lua = "lua",
|
2022-11-08 20:59:11 +00:00
|
|
|
sublime = "tmTheme",
|
2022-11-10 17:12:24 +00:00
|
|
|
delta = "gitconfig",
|
2022-11-10 22:24:24 +00:00
|
|
|
terminator = "conf",
|
2023-01-18 14:06:08 +00:00
|
|
|
prism = "js",
|
2022-09-05 14:17:10 +00:00
|
|
|
}
|
|
|
|
-- map of style to style name
|
|
|
|
local styles = {
|
|
|
|
storm = " Storm",
|
|
|
|
night = "",
|
|
|
|
day = " Day",
|
2022-09-18 21:46:44 +00:00
|
|
|
moon = " Moon",
|
2022-09-05 14:17:10 +00:00
|
|
|
}
|
2021-04-20 12:24:44 +00:00
|
|
|
|
2022-09-05 14:17:10 +00:00
|
|
|
for extra, ext in pairs(extras) do
|
2023-01-18 14:06:08 +00:00
|
|
|
package.loaded["tokyonight.extra." .. extra] = nil
|
2022-09-05 14:17:10 +00:00
|
|
|
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 })
|
2022-09-18 21:51:39 +00:00
|
|
|
local fname = extra .. "/tokyonight_" .. style .. "." .. ext
|
2022-09-05 14:17:10 +00:00
|
|
|
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
|
2022-09-05 14:17:10 +00:00
|
|
|
|
|
|
|
return M
|