From 8d303ae4f401fa570a36f7533cc0a9176c6605d3 Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 19 Jan 2026 19:21:17 +0000 Subject: [PATCH] add autocommand for theme update on SIGUSR1 signal This change sets up an autocommand to update the colorscheme when the system theme changes, triggered by the SIGUSR1 signal from an external watcher script. --- lua/settings.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) 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()