From 70ca40cfe7bfdd5c4b7a7b1ef7a06ee2bbf9db0a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 5 Sep 2022 16:17:10 +0200 Subject: [PATCH] fix: improved extra generation (fixes some wrong color) --- extras/kitty_tokyonight_day.conf | 4 +- extras/kitty_tokyonight_night.conf | 4 +- extras/kitty_tokyonight_storm.conf | 2 +- extras/tmux_tokyonight_day.tmux | 14 +++---- extras/tmux_tokyonight_night.tmux | 14 +++---- lua/tokyonight/extra/init.lua | 65 ++++++++++++++++-------------- 6 files changed, 54 insertions(+), 49 deletions(-) diff --git a/extras/kitty_tokyonight_day.conf b/extras/kitty_tokyonight_day.conf index d0c95b5..6a11bc7 100644 --- a/extras/kitty_tokyonight_day.conf +++ b/extras/kitty_tokyonight_day.conf @@ -16,7 +16,7 @@ cursor_text_color #e1e2e7 # Tabs active_tab_background #2e7de9 -active_tab_foreground #d4d6e4 +active_tab_foreground #e9e9ec inactive_tab_background #c4c8da inactive_tab_foreground #8990b3 #tab_bar_background #e9e9ed @@ -44,4 +44,4 @@ color15 #3760bf # extended colors color16 #b15c00 color17 #c64343 - + \ No newline at end of file diff --git a/extras/kitty_tokyonight_night.conf b/extras/kitty_tokyonight_night.conf index fa4e665..b9dc2db 100644 --- a/extras/kitty_tokyonight_night.conf +++ b/extras/kitty_tokyonight_night.conf @@ -16,7 +16,7 @@ cursor_text_color #1a1b26 # Tabs active_tab_background #7aa2f7 -active_tab_foreground #1f2335 +active_tab_foreground #16161e inactive_tab_background #292e42 inactive_tab_foreground #545c7e #tab_bar_background #15161E @@ -44,4 +44,4 @@ color15 #c0caf5 # extended colors color16 #ff9e64 color17 #db4b4b - + \ No newline at end of file diff --git a/extras/kitty_tokyonight_storm.conf b/extras/kitty_tokyonight_storm.conf index 8b6fa00..4288f34 100644 --- a/extras/kitty_tokyonight_storm.conf +++ b/extras/kitty_tokyonight_storm.conf @@ -44,4 +44,4 @@ color15 #c0caf5 # extended colors color16 #ff9e64 color17 #db4b4b - + \ No newline at end of file diff --git a/extras/tmux_tokyonight_day.tmux b/extras/tmux_tokyonight_day.tmux index 65f1119..c6b1fea 100644 --- a/extras/tmux_tokyonight_day.tmux +++ b/extras/tmux_tokyonight_day.tmux @@ -13,7 +13,7 @@ set -g pane-active-border-style "fg=#2e7de9" set -g status "on" set -g status-justify "left" -set -g status-style "fg=#2e7de9,bg=#d4d6e4" +set -g status-style "fg=#2e7de9,bg=#e9e9ec" set -g status-left-length "100" set -g status-right-length "100" @@ -21,12 +21,12 @@ set -g status-right-length "100" set -g status-left-style NONE set -g status-right-style NONE -set -g status-left "#[fg=#e9e9ed,bg=#2e7de9,bold] #S #[fg=#2e7de9,bg=#d4d6e4,nobold,nounderscore,noitalics]" -set -g status-right "#[fg=#d4d6e4,bg=#d4d6e4,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#d4d6e4] #{prefix_highlight} #[fg=#a8aecb,bg=#d4d6e4,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#a8aecb] %Y-%m-%d  %I:%M %p #[fg=#2e7de9,bg=#a8aecb,nobold,nounderscore,noitalics]#[fg=#e9e9ed,bg=#2e7de9,bold] #h " +set -g status-left "#[fg=#e9e9ed,bg=#2e7de9,bold] #S #[fg=#2e7de9,bg=#e9e9ec,nobold,nounderscore,noitalics]" +set -g status-right "#[fg=#e9e9ec,bg=#e9e9ec,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#e9e9ec] #{prefix_highlight} #[fg=#a8aecb,bg=#e9e9ec,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#a8aecb] %Y-%m-%d  %I:%M %p #[fg=#2e7de9,bg=#a8aecb,nobold,nounderscore,noitalics]#[fg=#e9e9ed,bg=#2e7de9,bold] #h " -setw -g window-status-activity-style "underscore,fg=#6172b0,bg=#d4d6e4" +setw -g window-status-activity-style "underscore,fg=#6172b0,bg=#e9e9ec" setw -g window-status-separator "" -setw -g window-status-style "NONE,fg=#6172b0,bg=#d4d6e4" -setw -g window-status-format "#[fg=#d4d6e4,bg=#d4d6e4,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#d4d6e4,bg=#d4d6e4,nobold,nounderscore,noitalics]" -setw -g window-status-current-format "#[fg=#d4d6e4,bg=#a8aecb,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#a8aecb,bold] #I  #W #F #[fg=#a8aecb,bg=#d4d6e4,nobold,nounderscore,noitalics]" +setw -g window-status-style "NONE,fg=#6172b0,bg=#e9e9ec" +setw -g window-status-format "#[fg=#e9e9ec,bg=#e9e9ec,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#e9e9ec,bg=#e9e9ec,nobold,nounderscore,noitalics]" +setw -g window-status-current-format "#[fg=#e9e9ec,bg=#a8aecb,nobold,nounderscore,noitalics]#[fg=#2e7de9,bg=#a8aecb,bold] #I  #W #F #[fg=#a8aecb,bg=#e9e9ec,nobold,nounderscore,noitalics]" \ No newline at end of file diff --git a/extras/tmux_tokyonight_night.tmux b/extras/tmux_tokyonight_night.tmux index 656f3ff..49adf9d 100644 --- a/extras/tmux_tokyonight_night.tmux +++ b/extras/tmux_tokyonight_night.tmux @@ -13,7 +13,7 @@ set -g pane-active-border-style "fg=#7aa2f7" set -g status "on" set -g status-justify "left" -set -g status-style "fg=#7aa2f7,bg=#1f2335" +set -g status-style "fg=#7aa2f7,bg=#16161e" set -g status-left-length "100" set -g status-right-length "100" @@ -21,12 +21,12 @@ set -g status-right-length "100" set -g status-left-style NONE set -g status-right-style NONE -set -g status-left "#[fg=#15161E,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]" -set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#7aa2f7,bold] #h " +set -g status-left "#[fg=#15161E,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#16161e,nobold,nounderscore,noitalics]" +set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#7aa2f7,bold] #h " -setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335" +setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#16161e" setw -g window-status-separator "" -setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335" -setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]" -setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]" +setw -g window-status-style "NONE,fg=#a9b1d6,bg=#16161e" +setw -g window-status-format "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]" +setw -g window-status-current-format "#[fg=#16161e,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]" \ No newline at end of file diff --git a/lua/tokyonight/extra/init.lua b/lua/tokyonight/extra/init.lua index 329b07a..3791349 100644 --- a/lua/tokyonight/extra/init.lua +++ b/lua/tokyonight/extra/init.lua @@ -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