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:
parent
53502acd6e
commit
8d303ae4f4
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue