From 8748ef729f192c38c8ce5412288de822facd91e2 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Sun, 10 Mar 2024 13:10:27 +0700 Subject: [PATCH] add: update config --- lua/custom/plugins/lualine.lua | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/lualine.lua b/lua/custom/plugins/lualine.lua index 3c07b7d..fcd870c 100644 --- a/lua/custom/plugins/lualine.lua +++ b/lua/custom/plugins/lualine.lua @@ -157,7 +157,44 @@ return { green1 = "#bd93f9", } - local bubbles_theme = { + -- check config for theme + local set_theme + local bubbles_theme = {} + local data_exists, config = pcall(require, "core.config") + if data_exists then + if config.colorscheme ~= nil then + local color = config.colorscheme + switch(color, { + ["tokyonight"] = function() + set_theme = "auto" + end, + ["tokyonight-night"] = function() + set_theme = "auto" + end, + ["tokyonight-storm"] = function() + set_theme = "auto" + end, + ["tokyonight-day"] = function() + set_theme = "auto" + end, + ["tokyonight-moon"] = function() + set_theme = "auto" + end, + ["dracula"] = function() + local clr = require("dracula").colors() + colors.blue = clr.green + colors.black = clr.black + colors.cyan = clr.yellow + set_theme = bubbles_theme + end, + default = function() + set_theme = "auto" + end, + }) + end + end + + bubbles_theme = { normal = { a = { fg = colors.black, bg = colors.skyblue_1 }, b = { fg = colors.white, bg = colors.grey }, @@ -190,6 +227,11 @@ return { c = { fg = colors.black, bg = colors.black_transparant }, }, } + + if set_theme == "auto" then + bubbles_theme = vim.fn.fnamemodify("auto", ":t") + end + require("lualine").setup({ options = { theme = bubbles_theme,