1
0
Fork 0

wezterm: more theme and lua shenanigans :D

This commit is contained in:
Von Random 2022-09-06 00:43:44 +03:00
parent 8a05339c71
commit da30490b19

View file

@ -1,7 +1,6 @@
local wt = require 'wezterm' local wt = require 'wezterm'
local current_theme = 1
local theme = local theme =
'Parker Brothers (terminal.sexy)' 'PencilDark'
local themes = { local themes = {
'BirdsOfParadise', 'BirdsOfParadise',
'Blazer', 'Blazer',
@ -29,31 +28,42 @@ local themes = {
'MonaLisa', -- impressively good, but very red and dark 'MonaLisa', -- impressively good, but very red and dark
'Neopolitan', -- lovely blue, shitty contrast 'Neopolitan', -- lovely blue, shitty contrast
'Parker Brothers (terminal.sexy)', -- unique but kinda dark 'Parker Brothers (terminal.sexy)', -- unique but kinda dark
'PaulMillr', -- bright and clear
'PencilDark', -- very nice, matches PencilColors
} }
wt.on('next-theme', function(window) local theme_n = 0
if current_theme < #themes then function switch_theme(number, window)
current_theme = current_theme + 1 theme_n = theme_n + number
else if theme_n < 1 then theme_n = #themes end
current_theme = 1 if theme_n > #themes then theme_n = 1 end
window:set_config_overrides { color_scheme = themes[theme_n] }
end end
color_scheme = themes[current_theme] wt.on('prev-theme', function(window) switch_theme(-1, window) end)
wt.log_info(color_scheme) wt.on('next-theme', function(window) switch_theme( 1, window) end)
window:set_config_overrides {color_scheme=color_scheme} 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) end)
wt.on('reset-theme', function(window) wt.on('query-theme', function(window)
wt.log_info(theme) overrides = window:get_config_overrides()
window:set_config_overrides {} wt.log_info(overrides['color_scheme'])
end) end)
return { return {
font_size = 14, font_size = 15,
bold_brightens_ansi_colors = false, bold_brightens_ansi_colors = false,
use_resize_increments = true, use_resize_increments = true,
color_scheme = theme, color_scheme = theme,
keys = { keys = {
{ key = 'c', mods = 'META', action = wt.action.Copy }, { key = 'c', mods = 'META', action = wt.action.Copy },
{ key = 'v', mods = 'META', action = wt.action.Paste }, { key = 'v', mods = 'META', action = wt.action.Paste },
{ key = 'z', mods = 'CTRL', action = wt.action.EmitEvent 'next-theme'}, { key = 'a', mods = 'META', action = wt.action.EmitEvent 'prev-theme' },
{ key = 'x', mods = 'CTRL', action = wt.action.EmitEvent 'reset-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' },
}, },
window_padding = { window_padding = {
left = 0, right = 0, top = 0, bottom = 0, left = 0, right = 0, top = 0, bottom = 0,