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.
This commit is contained in:
Ray Elliott 2026-01-19 19:21:17 +00:00
parent 53502acd6e
commit 8d303ae4f4
1 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,16 @@ end
-- Set background based on system theme on startup -- Set background based on system theme on startup
set_background_from_system() 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 -- Store initial working directory as project root
-- Used by netrw navigation to return to project root after following symlinks -- Used by netrw navigation to return to project root after following symlinks
vim.g.project_root = vim.fn.getcwd() vim.g.project_root = vim.fn.getcwd()