Add check for dark mode
This commit is contained in:
parent
822d8281da
commit
c847918937
1 changed files with 8 additions and 1 deletions
9
init.lua
9
init.lua
|
|
@ -51,7 +51,14 @@ local plugins = require("plugins")
|
||||||
require("lazy").setup(plugins)
|
require("lazy").setup(plugins)
|
||||||
|
|
||||||
vim.cmd.colorscheme "catppuccin"
|
vim.cmd.colorscheme "catppuccin"
|
||||||
opt.background = "light"
|
|
||||||
|
-- if $XDG_STATE_HOME/darkmode exists, set dark background, light other wise
|
||||||
|
local path = ( vim.fn.getenv("XDG_STATE_HOME") or "~/.local/state" ) .. "/darkmode"
|
||||||
|
if vim.fn.filereadable(path) == 1 then
|
||||||
|
opt.background = "dark"
|
||||||
|
else
|
||||||
|
opt.background = "light"
|
||||||
|
end
|
||||||
|
|
||||||
require("mappings")
|
require("mappings")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue