From 1155311da0d17669fe42d999d4746e216bfddc62 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 1 Sep 2025 14:37:47 -0400 Subject: [PATCH] feat(theme): implement dynamic themeing --- lua/data/types.lua | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lua/data/types.lua b/lua/data/types.lua index cfcc7a5..5a550dd 100644 --- a/lua/data/types.lua +++ b/lua/data/types.lua @@ -8,6 +8,24 @@ local M = {} +-- ━━━━━━━━━━━━━━━━━━━━━━━━ Get color theme data ━━━━━━━━━━━━━━━━━━━━━ +-- File path to the theme.txt file +local theme_file = vim.fn.expand('~/.config/wezterm/changer/theme.txt') + +-- A variable to hold the colorscheme name +local colorscheme_name = 'catppuccin-mocha' -- Default to Mocha + +-- Try to read the theme name from the file +local file = io.open(theme_file, 'r') +if file then + local content = file:read('*a') + file:close() + if content then + -- Trim leading/trailing whitespace and newlines from the string + colorscheme_name = content:gsub('^%s*(.-)%s*$', '%1') + end +end + -- ━━━━━━━━━━━━━━━━━━━━━━━━━━━ Mode Indicators ━━━━━━━━━━━━━━━━━━━━━━━━━━━ --- A collection of functions that return icons and names for --- the current mode. @@ -605,7 +623,8 @@ M.kulala = { --- LazyVim configuration options M.lazyvim = { opts = { - colorscheme = 'catppuccin-mocha', + colorscheme = colorscheme_name, + -- colorscheme = 'catppuccin-mocha', news = { lazyvim = true, neovim = true,