From b03446da86565bab2676257892c5d07473e6a52f Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Thu, 26 Mar 2026 16:06:11 +0000 Subject: [PATCH] remove theme sync --- init.lua | 5 ----- lua/chadrc.lua | 15 +-------------- lua/options.lua | 6 ------ lua/theme-sync.lua | 41 ----------------------------------------- 4 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 lua/theme-sync.lua diff --git a/init.lua b/init.lua index b7d5680..0fda20c 100644 --- a/init.lua +++ b/init.lua @@ -35,8 +35,3 @@ require "nvchad.autocmds" vim.schedule(function() require "mappings" end) - --- Apply correct theme on startup based on current darkman mode -vim.schedule(function() - require("theme-sync").sync() -end) diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 5b01e96..1b4da59 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -2,19 +2,6 @@ -- https://github.com/NvChad/ui/blob/v2.5/lua/nvconfig.lua -- Please read that file to know all available options :( --- Get system theme from darkman -local function get_system_theme() - local handle = io.popen("darkman get 2>/dev/null") - if handle then - local result = handle:read("*a") - handle:close() - if result and result:match("light") then - return "onenord_light" - end - end - return "onenord" -- default dark theme -end - ---@type ChadrcConfig local M = { ui = { @@ -23,7 +10,7 @@ local M = { }, }, base46 = { - theme = get_system_theme(), + theme = "onenord", }, nvdash = { diff --git a/lua/options.lua b/lua/options.lua index 0139bca..2bc3840 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -21,9 +21,3 @@ vim.g.neovide_scroll_animation_length = 0.15 vim.g.neovide_cursor_animation_length = 0.11 vim.o.swapfile = false - --- Command to manually sync theme with system -vim.api.nvim_create_user_command("ThemeSync", function() - require("theme-sync").sync() - vim.notify("Theme synced with system", vim.log.levels.INFO) -end, { desc = "Sync theme with system (darkman)" }) diff --git a/lua/theme-sync.lua b/lua/theme-sync.lua deleted file mode 100644 index 1c240d9..0000000 --- a/lua/theme-sync.lua +++ /dev/null @@ -1,41 +0,0 @@ --- Sync Neovim theme with system (darkman) - -local M = {} - --- Theme mappings -M.themes = { - light = "onenord_light", - dark = "onenord", -- Change to your preferred dark theme -} - --- Get current system theme from darkman -function M.get_system_mode() - local handle = io.popen("darkman get 2>/dev/null") - if handle then - local result = handle:read("*a") - handle:close() - result = result and result:gsub("%s+$", "") or nil - if result == "light" then - return "light" - end - end - return "dark" -end - --- Apply theme based on mode (mirrors NvChad's toggle_theme logic) -function M.apply_theme(mode) - local theme = M.themes[mode] or M.themes.dark - - -- Update in-memory config so base46.compile() picks up the new theme - require("nvconfig").base46.theme = theme - - require("base46").load_all_highlights() -end - --- Sync with system theme -function M.sync() - local mode = M.get_system_mode() - M.apply_theme(mode) -end - -return M