diff --git a/templates/wezterm/includes/colors.lua.j2 b/templates/wezterm/includes/colors.lua.j2 index b8cd344..46a1194 100644 --- a/templates/wezterm/includes/colors.lua.j2 +++ b/templates/wezterm/includes/colors.lua.j2 @@ -1,10 +1,35 @@ -- {{ ansible_managed }} +local wezterm = require 'wezterm' + +-- wezterm.gui is not available to the mux server, so take care to +-- do something reasonable when this config is evaluated by the mux +local function get_appearance() + if wezterm.gui then + return wezterm.gui.get_appearance() + end + return 'Dark' +end + +local function scheme_for_appearance(appearance) + if appearance:find 'Dark' then + return 'Dark' + else + return 'Light' + end +end + return { - colors = { - -- The default text color - foreground = 'black', - -- The default background color - background = 'white' - } + color_schemes = { + ['Dark'] = { + background = 'rgb(41, 46, 50)', + foreground = 'white' + }, + ['Light'] = { + background = 'white', + foreground = 'black' + }, + }, + + color_scheme = scheme_for_appearance(get_appearance()), }