From b22d371263256503e4e87a4077418133405cdd3d Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 7 Oct 2024 13:53:51 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Bug(colorscheme):=20fixes=20to?= =?UTF-8?q?=20colorscheme=20automation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/colors.lua | 16 +++++++++++----- plugins/tabline.lua | 28 ++++++++++++++-------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/config/colors.lua b/config/colors.lua index 7ef4277..4408afa 100644 --- a/config/colors.lua +++ b/config/colors.lua @@ -13,22 +13,28 @@ local hour_angle = require("funcs").get_hour_angle(cur_hour) --- catppuccin theme ---@see catppuccin_documentation https://github.com/catppuccin/wezterm local function get_colorscheme(appearance) + local scheme = {} if WEZTERM.gui then if appearance:find("Dark") then - return "Catppuccin Mocha" + scheme.theme = "Catppuccin Mocha" + scheme.mode = "dark" else - return "Catppuccin Latte" + scheme.theme = "Catppuccin Latte" + scheme.mode = "light" end else - return "Catppuccin Mocha" + scheme.theme = "Catppuccin Mocha" + scheme.mode = "dark" end + return scheme end -THEME = get_colorscheme(wezterm.gui.get_appearance()) +COLORTHEME = get_colorscheme(wezterm.gui.get_appearance()).theme +COLORMODE = get_colorscheme(wezterm.gui.get_appearance()).mode local opts = { -- Color Scheme - color_scheme = THEME, + color_scheme = COLORTHEME, -- Tab Bar Colors colors = { -- Compose Cursor diff --git a/plugins/tabline.lua b/plugins/tabline.lua index ada87f9..8ce7fd0 100644 --- a/plugins/tabline.lua +++ b/plugins/tabline.lua @@ -1,26 +1,25 @@ -local wezterm = WEZTERM local config = CONFIG local types = require("types") local funcs = require("funcs") local batteries = BATTERIES -local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabline.wez") +local tabline = WEZTERM.plugin.require("https://github.com/michaelbrusegard/tabline.wez") local tab_opts = { options = { icons_enabled = true, - theme = THEME, + theme = COLORTHEME, section_separators = { - left = wezterm.nerdfonts.ple_right_half_circle_thick, - right = wezterm.nerdfonts.ple_left_half_circle_thick, + left = WEZTERM.nerdfonts.ple_right_half_circle_thick, + right = WEZTERM.nerdfonts.ple_left_half_circle_thick, }, component_separators = { - left = wezterm.nerdfonts.ple_right_half_circle_thin, - right = wezterm.nerdfonts.ple_left_half_circle_thin, + left = WEZTERM.nerdfonts.ple_right_half_circle_thin, + right = WEZTERM.nerdfonts.ple_left_half_circle_thin, }, tab_separators = { - left = wezterm.nerdfonts.ple_right_half_circle_thick, - right = wezterm.nerdfonts.ple_left_half_circle_thick, + left = WEZTERM.nerdfonts.ple_right_half_circle_thick, + right = WEZTERM.nerdfonts.ple_left_half_circle_thick, }, }, sections = { @@ -33,7 +32,7 @@ local tab_opts = { tab_active = { { "zoomed", - icon = wezterm.nerdfonts.oct_zoom_in, + icon = WEZTERM.nerdfonts.oct_zoom_in, padding = { left = 0, right = 0 }, }, { @@ -43,7 +42,7 @@ local tab_opts = { end, padding = { left = 0, right = 0 }, }, - wezterm.nerdfonts.ple_right_half_circle_thin, + WEZTERM.nerdfonts.ple_right_half_circle_thin, { "tab", fmt = function(str) @@ -55,13 +54,13 @@ local tab_opts = { { "parent", padding = { left = 0, right = 0 } }, "/", { "cwd", padding = { left = 0, right = 1 } }, - wezterm.nerdfonts.ple_left_half_circle_thin, + WEZTERM.nerdfonts.ple_left_half_circle_thin, { "process", padding = { left = 0, right = 0 } }, }, tab_inactive = { { "zoomed", - icon = wezterm.nerdfonts.oct_zoom_in, + icon = WEZTERM.nerdfonts.oct_zoom_in, padding = { left = 0, right = 0 }, }, { @@ -125,6 +124,7 @@ local function apply_tabline_config(conf) top = 0, bottom = 0, } + tabline.get_colors() local normbg = require("tabline.config").colors.normal_mode.c.bg conf.colors = { tab_bar = { @@ -132,7 +132,7 @@ local function apply_tabline_config(conf) inactive_tab_edge = normbg, }, } - config.status_update_interval = 500 + conf.status_update_interval = 500 end apply_tabline_config(config)