From 274617da24e6f6f618951fe4b1e7b4c3389a7116 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jul 2024 21:39:01 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=9B=20Auto-Dark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move auto-dark-mode to themes --- lua/themes/auto-dark-mode.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lua/themes/auto-dark-mode.lua diff --git a/lua/themes/auto-dark-mode.lua b/lua/themes/auto-dark-mode.lua new file mode 100644 index 0000000..7aeb191 --- /dev/null +++ b/lua/themes/auto-dark-mode.lua @@ -0,0 +1,26 @@ +-- ----------------------------------------------------------------------------- +-- ----------------------------- 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") + local root = string.find(user, "root") + return not ssh and not root + end, +} \ No newline at end of file