From e7401fc495d402d24c88a8fc97d7f1649d72a3fd Mon Sep 17 00:00:00 2001 From: Michael Yockey Date: Thu, 13 Feb 2025 20:59:20 -0500 Subject: [PATCH] wez: Dark mode Adds a dark mode theme and setups automatic theme switching based on system light and dark mode. --- .../wezterm/colors/tempus_classic.toml | 35 +++++++++++++++++++ wez/.config/wezterm/wezterm.lua | 18 +++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 wez/.config/wezterm/colors/tempus_classic.toml diff --git a/wez/.config/wezterm/colors/tempus_classic.toml b/wez/.config/wezterm/colors/tempus_classic.toml new file mode 100644 index 0000000..8816db6 --- /dev/null +++ b/wez/.config/wezterm/colors/tempus_classic.toml @@ -0,0 +1,35 @@ +[colors] +ansi = [ + "#232323", + "#d4823d", + "#8c9e3d", + "#b1942b", + "#6e9cb0", + "#b58d88", + "#6da280", + "#949d9f", +] +brights = [ + "#312e30", + "#d0913d", + "#96a42d", + "#a8a030", + "#8e9cc0", + "#d58888", + "#7aa880", + "#aeadaf", +] + +cursor_bg = "#aeadaf" +cursor_border = "#aeadaf" +cursor_fg = "#232323" +background = "#232323" +foreground = "#aeadaf" +selection_bg = "#aeadaf" +selection_fg = "#232323" + +[metadata] +name = "Tempus Classic" +aliases = ["Tempus Classic"] +author = "protesilaos" +origin_url = "https://github.com/protesilaos/tempus-themes/blob/master/yaml/tempus_past.yml" diff --git a/wez/.config/wezterm/wezterm.lua b/wez/.config/wezterm/wezterm.lua index 1066738..1e5ed63 100644 --- a/wez/.config/wezterm/wezterm.lua +++ b/wez/.config/wezterm/wezterm.lua @@ -1,7 +1,23 @@ local wezterm = require('wezterm') local config = wezterm.config_builder() -config.color_scheme = "Tempus Past" config.font = wezterm.font('TX-02') config.font_size = 17 +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 'Tempus Classic' + else + return 'Tempus Past' + end +end + +config.color_scheme = scheme_for_appearance(get_appearance()) + return config