feat(wezterm): sync nvim with OS theme

This commit is contained in:
winston 2022-11-14 14:54:40 +01:00
parent 412aa4f887
commit 8c598cb5ca
Signed by: winston
GPG key ID: 3786770EDBC2B481

View file

@ -201,6 +201,20 @@ local darkTheme = "OLEDppuccin"
local lightTheme = "Catppuccin Latte" local lightTheme = "Catppuccin Latte"
local function scheme_for_appearance(appearance) local function scheme_for_appearance(appearance)
local f = io.popen("nvr --serverlist")
if f:lines() ~= nil then
local theme
if appearance:find("Dark") then
theme = "mocha"
else
theme = "latte"
end
for name in f:lines() do
io.popen("nvr --servername " .. name .. ' --remote-send ":Catppuccin ' .. theme .. '<CR>"')
end
end
if string.match(wezterm.target_triple, "linux") then if string.match(wezterm.target_triple, "linux") then
return darkTheme return darkTheme
end end