From 8c598cb5ca88285bfe8313ed354fa75a201e7e8c Mon Sep 17 00:00:00 2001 From: winston Date: Mon, 14 Nov 2022 14:54:40 +0100 Subject: [PATCH] feat(wezterm): sync nvim with OS theme --- dot_config/wezterm/wezterm.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua index 8e44f2c..cee2997 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/dot_config/wezterm/wezterm.lua @@ -201,6 +201,20 @@ local darkTheme = "OLEDppuccin" local lightTheme = "Catppuccin Latte" 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 .. '"') + end + end + if string.match(wezterm.target_triple, "linux") then return darkTheme end