Add wezterm variables script

This commit is contained in:
Talia 2024-08-15 08:54:56 +02:00
parent d1b2eba724
commit 3fd1bf095f
Signed by: darkwiiplayer
GPG key ID: 7808674088232B3E

26
wezterm/variables.lua Normal file
View file

@ -0,0 +1,26 @@
local variables = {}
variables.callbacks = {}
function variables.callbacks.bgcolor(window, _, color)
local overrides = window:get_config_overrides() or {}
if color ~= "" then
overrides.colors = { background = color }
else
overrides.colors = nil
end
window:set_config_overrides(overrides)
end
function variables.listen()
local wezterm = require "wezterm"
wezterm.on("user-var-changed", function(window,pane,name,value)
if variables.callbacks[name] then
return variables.callbacks[name](window, pane, value)
end
end)
end
return variables