auto-dark-mode.nvim
auto-dark-mode.nvim copied to clipboard
More theme detection methods?
I guess the current code won't work, if I connect from a light-bg terminal in Windows to a dark-bg Linux machine and launch nvim.
How about more dark/light theme detection methods? Allow users to config, or choose the best suitable one (e.g., do not use local command to detect in a ssh session).
:+1: to this. One of the annoyances I've had is using a root shell with nvim and it not detecting the WMs theme settings.
light-bg terminal in Windows to a dark-bg Linux machine
I am not able to understand. How does the Linux machine background matter here?
hi! are u suggesting adding more implementations or adding a way for u to provide your own callback to detect the theme?
@alexandradeas
👍 to this. One of the annoyances I've had is using a root shell with nvim and it not detecting the WMs theme settings.
We have some logic that should handle this: https://github.com/f-person/auto-dark-mode.nvim/blob/02ef9553e2a1d6e861bc6955d58ce5883d28a6ad/lua/auto-dark-mode/init.lua#L131-L145
This should use your non-elevated user id to query the current desktop environment's dark mode.
In general, I'd advise not running neovim as root, especially with plugins, since you're handing root control over to unaudited code, prefer sudo -e when you can.
#46 somewhat addresses this, by allowing the user to override how the system appearance is queried. I'll tackle that PR next after hopefully finally finishing #35 this weekend.
Update regarding the running neovim as root situation, I forgot that #35 also fixed an issue there - running nvim as root via sudo, and still having it sync with your system should work now, but I still don't recommend it.
hi! are u suggesting adding more implementations or adding a way for u to provide your own callback to detect the theme?
Exactly!
By the way, the only correct way of automatic bg setting is to infer the background of the active terminal emulator (even a remote one). That might be different from the current OS theme.
I am happy to take some feedback on #46 if this is something that people would like :)