Files
neovim-config/lua/plugins/auto-dark-mode.lua
T
rootiest c0a3511384 🧙 Major Restructuring Update
- Plugins are now properly organized into separate folders.
- General configurations are also now organized by category into
folders.
- Now using lazyvim-defined plugins whenever possible for a more
consistent and clean experience.
- Duplicate manual plugin definitions were removed.
- Extensive testing has been performed to ensure config works on fresh
installs and a variety of systems.
- Further slimming of manual plugins and an updated dependency list is
forthcoming.
2024-07-08 10:17:08 -04:00

25 lines
879 B
Lua

-- -----------------------------------------------------------------------------
-- ----------------------------- auto-dark-mode --------------------------------
-- -----------------------------------------------------------------------------
return {
"f-person/auto-dark-mode.nvim",
lazy = true,
opts = {
update_interval = 1000,
set_dark_mode = function()
vim.o.background = "dark"
local kitty_theme = os.getenv("KITTY_THEME")
vim.cmd.colorscheme(kitty_theme or "catppuccin-frappe")
end,
set_light_mode = function()
vim.o.background = "light"
local kitty_theme = os.getenv("KITTY_THEME")
vim.cmd.colorscheme(kitty_theme or "catppuccin-latte")
end,
},
cond = function() -- Not Using SSH or root
local ssh = os.getenv("SSH_TTY")
local user = os.getenv("USER")
return not ssh and user ~= "root"
end,
}