dotfiles/home/apps/neovim/lua/plugins/auto-dark-mode.lua

34 lines
837 B
Lua
Raw Normal View History

return {
{
"f-person/auto-dark-mode.nvim",
config = function()
local autodm = require("auto-dark-mode")
if vim.fn.has("mac") ~= 1 then
return
end
local update_neovide_background = function()
if not vim.g.neovide then
return
end
local ctp_present, ctp = pcall(require, "catppuccin.palettes")
if ctp_present then
vim.g.neovide_background_color = ctp.get_palette().base
end
end
autodm.setup({
set_dark_mode = function()
vim.api.nvim_set_option("background", "dark")
update_neovide_background()
end,
set_light_mode = function()
vim.api.nvim_set_option("background", "light")
update_neovide_background()
end,
})
autodm.init()
end,
},
}