Is there a nvim event which can be called from outside nvim?

Viewed 27

I want to change the colorscheme of nvim upon my system changing its appearance to light/dark. The best solution I've found is to check defaults read -g AppleInterfaceStyle every couple of seconds, but I'm wondering if there is a way for nvim to receive an external input and trigger an autocmd so that I can avoid checking every couple of seconds if the system appearance has changed.

1 Answers

Write Lua binary extension module (using Objective C, for example). Then register some OS callback (I guess there should be one for a "theme" change?) by native API.

Related