diff --git a/lua/settings.lua b/lua/settings.lua index c416555..4999b45 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -23,6 +23,16 @@ end -- Set background based on system theme on startup set_background_from_system() +-- Handle SIGUSR1 signal to update theme when system theme changes +-- External watcher script (scripts/theme-watcher.sh) sends this signal +vim.api.nvim_create_autocmd('Signal', { + pattern = 'SIGUSR1', + callback = function() + set_background_from_system() + end, + desc = 'Update colorscheme when system theme changes', +}) + -- Store initial working directory as project root -- Used by netrw navigation to return to project root after following symlinks vim.g.project_root = vim.fn.getcwd()