You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
469 B
25 lines
469 B
local day = 9
|
|
local night = 19
|
|
local hour = os.date("*t").hour
|
|
print("hour" .. hour)
|
|
|
|
local themes = { "catppuccin-macchiato", "catppuccin-mocha" }
|
|
local theme = 1
|
|
|
|
if day <= hour and hour < night then
|
|
theme = 1
|
|
else
|
|
theme = 2
|
|
end
|
|
vim.cmd.colorscheme(themes[theme])
|
|
|
|
local function toggletheme()
|
|
if theme == 1 then
|
|
theme = 2
|
|
else
|
|
theme = 1
|
|
end
|
|
vim.cmd.colorscheme(themes[theme])
|
|
end
|
|
|
|
vim.api.nvim_create_user_command("ToggleTheme", toggletheme, {})
|