From 212be329168ce13dbbf6d657eb31420bba060bcf Mon Sep 17 00:00:00 2001 From: Von Random Date: Tue, 6 Sep 2022 11:12:33 +0300 Subject: [PATCH] wezterm is cool --- wezterm.lua | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/wezterm.lua b/wezterm.lua index c241e51..b7aef5c 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -31,6 +31,11 @@ local themes = { 'PaulMillr', -- bright and clear 'PencilDark', -- very nice, matches PencilColors } +local webinar_overrides = { + harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' }, + color_scheme = 'PencilLight', +} + local theme_n = 0 function switch_theme(number, window) theme_n = theme_n + number @@ -38,35 +43,35 @@ function switch_theme(number, window) if theme_n > #themes then theme_n = 1 end window:set_config_overrides { color_scheme = themes[theme_n] } end + +wt.on('update-right-status', function(window, pane) + local theme_info = string.format( + '%s %s ', wt.nerdfonts.fa_terminal, + window:effective_config().color_scheme + ) + window:set_right_status(wt.format {{ Text = theme_info }}) +end) wt.on('prev-theme', function(window) switch_theme(-1, window) end) wt.on('next-theme', function(window) switch_theme( 1, window) end) -wt.on('reset-theme', function(window) window:set_config_overrides {} end) -wt.on('light-theme', function(window) - window:set_config_overrides { - harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' }, - font_size = 16, - color_scheme = 'PencilLight', - } -end) -wt.on('query-theme', function(window) - overrides = window:get_config_overrides() - wt.log_info(overrides['color_scheme']) -end) +wt.on('reset-theme', function(window) window:set_config_overrides() end) +wt.on('webinar', function(window) window:set_config_overrides(webinar_overrides) end) + return { font_size = 15, - bold_brightens_ansi_colors = false, - use_resize_increments = true, color_scheme = theme, + cursor_blink_rate = 0, + check_for_updates = false, + use_resize_increments = true, + bold_brightens_ansi_colors = false, + window_padding = { + left = 0, right = 0, top = 0, bottom = 0, + }, keys = { { key = 'c', mods = 'META', action = wt.action.Copy }, { key = 'v', mods = 'META', action = wt.action.Paste }, { key = 'a', mods = 'META', action = wt.action.EmitEvent 'prev-theme' }, { key = 's', mods = 'META', action = wt.action.EmitEvent 'next-theme' }, - { key = 'd', mods = 'META', action = wt.action.EmitEvent 'light-theme' }, - { key = 'q', mods = 'META', action = wt.action.EmitEvent 'query-theme' }, + { key = 'r', mods = 'META', action = wt.action.EmitEvent 'reset-theme' }, + { key = 'd', mods = 'META', action = wt.action.EmitEvent 'webinar' }, }, - window_padding = { - left = 0, right = 0, top = 0, bottom = 0, - }, - cursor_blink_rate = 0, }