From 2c5e7661d650dc0e0bbca35bc0992c40bc050039 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 7 Oct 2024 13:32:34 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Feat(colorscheme):=20automate=20lig?= =?UTF-8?q?ht/dark=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automates selecting between Catppuccin Mocha and Catppuccin Latte depending on the darkmode state. --- config/colors.lua | 18 +++++++++++++++++- plugins/tabline.lua | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config/colors.lua b/config/colors.lua index 0beba62..7ef4277 100644 --- a/config/colors.lua +++ b/config/colors.lua @@ -10,9 +10,25 @@ local cur_hour = wezterm.time.now():format("%H") 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) + if WEZTERM.gui then + if appearance:find("Dark") then + return "Catppuccin Mocha" + else + return "Catppuccin Latte" + end + else + return "Catppuccin Mocha" + end +end + +THEME = get_colorscheme(wezterm.gui.get_appearance()) + local opts = { -- Color Scheme - color_scheme = "Catppuccin Mocha", + color_scheme = THEME, -- Tab Bar Colors colors = { -- Compose Cursor diff --git a/plugins/tabline.lua b/plugins/tabline.lua index 8f84aa6..ada87f9 100644 --- a/plugins/tabline.lua +++ b/plugins/tabline.lua @@ -9,7 +9,7 @@ local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabl local tab_opts = { options = { icons_enabled = true, - theme = "Catppuccin Mocha", + theme = THEME, section_separators = { left = wezterm.nerdfonts.ple_right_half_circle_thick, right = wezterm.nerdfonts.ple_left_half_circle_thick,