🐛 Bug(colorscheme): fixes to colorscheme automation

This commit is contained in:
2024-10-07 13:53:51 -04:00
parent 9846e246ff
commit b22d371263
2 changed files with 25 additions and 19 deletions
+11 -5
View File
@@ -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
+14 -14
View File
@@ -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)