nvim: select colorscheme based on alacritty theme
the theme is read from file so this also works in tmux
This commit is contained in:
parent
bfe74b7499
commit
afc7829f1f
@ -112,10 +112,8 @@ vim.keymap.set("n", "<leader>ss", "<cmd>source ~/.config/nvim/after/plugin/luasn
|
||||
|
||||
key('n', '<F6>', function()
|
||||
if vim.o.background == "dark" then
|
||||
vim.cmd.colorscheme("bamboo-light")
|
||||
-- vim.o.background = "light"
|
||||
vim.o.background = "light"
|
||||
else
|
||||
vim.cmd.colorscheme("bamboo-vulgaris")
|
||||
-- vim.o.background = "dark"
|
||||
vim.o.background = "dark"
|
||||
end
|
||||
end)
|
||||
|
@ -1,5 +1,13 @@
|
||||
local function cwd()
|
||||
return vim.fn.getcwd()
|
||||
local function termnalbg()
|
||||
local ok, lines = pcall(io.lines, os.getenv('HOME') .. '/.config/alacritty/alacritty.toml')
|
||||
if ok then
|
||||
for line in lines do
|
||||
if string.find(line, 'light.toml') then
|
||||
return "light"
|
||||
end
|
||||
end
|
||||
end
|
||||
return "dark"
|
||||
end
|
||||
|
||||
return {
|
||||
@ -13,7 +21,7 @@ return {
|
||||
-- optional configuration here
|
||||
}
|
||||
require('bamboo').load()
|
||||
vim.cmd.colorscheme("bamboo-vulgaris")
|
||||
vim.o.background = termnalbg()
|
||||
end,
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user