2022-09-03 19:30:19 +03:00
|
|
|
local wt = require 'wezterm'
|
2022-09-07 12:30:45 +03:00
|
|
|
local fontsize_darwin = 15
|
|
|
|
local fontsize_others = 12
|
|
|
|
local theme_n = 0
|
2022-09-03 19:30:19 +03:00
|
|
|
local theme =
|
2022-09-06 00:43:44 +03:00
|
|
|
'PencilDark'
|
2022-09-03 19:30:19 +03:00
|
|
|
local themes = {
|
|
|
|
'BirdsOfParadise',
|
|
|
|
'Blazer',
|
|
|
|
'BlueBerryPie',
|
|
|
|
'Dark+', -- another great one | dark / black
|
|
|
|
'Doom Peacock', -- nice | dark / black / vivid
|
|
|
|
'DWM rob (terminal.sexy)',
|
|
|
|
'duskfox',
|
|
|
|
'Elio (Gogh)', -- teh best so far | dark / blue
|
|
|
|
'Espresso', -- nice, but more on the average side | dark / black
|
|
|
|
'Espresso Libre',
|
|
|
|
'Fahrenheit', -- all the colors are wrong, but looks cool | dark / red
|
|
|
|
'FlatRemix (Gogh)', -- pretty cool | dark / vivid
|
|
|
|
'Galaxy', -- pretty nice | dark / blue
|
|
|
|
'Galizur', -- great and vivid | dark
|
|
|
|
'GJM (terminal.sexy)', -- nice vivid | dark
|
|
|
|
'Glacier', -- vivid, very dark
|
|
|
|
'gotham (Gogh)', -- surprisingly good, compared to the vim theme
|
|
|
|
'Gruvbox Dark',
|
|
|
|
'HemisuDark (Gogh)', -- vivid, but dark
|
|
|
|
'hund (terminal.sexy)', -- pretty well-balanced dark
|
|
|
|
'Japanesque', -- balanced, average, dark
|
|
|
|
'Material (terminal.sexy)', -- unusual combination, balanced
|
|
|
|
'Medallion', -- quite fun reddish theme, dark
|
|
|
|
'MonaLisa', -- impressively good, but very red and dark
|
|
|
|
'Parker Brothers (terminal.sexy)', -- unique but kinda dark
|
2022-09-06 00:43:44 +03:00
|
|
|
'PaulMillr', -- bright and clear
|
|
|
|
'PencilDark', -- very nice, matches PencilColors
|
2022-09-03 19:30:19 +03:00
|
|
|
}
|
2022-09-06 11:12:33 +03:00
|
|
|
local webinar_overrides = {
|
|
|
|
harfbuzz_features = { 'calt=0', 'clig=0', 'liga=0' },
|
|
|
|
color_scheme = 'PencilLight',
|
|
|
|
}
|
|
|
|
|
2022-09-06 00:43:44 +03:00
|
|
|
function switch_theme(number, window)
|
|
|
|
theme_n = theme_n + number
|
|
|
|
if theme_n < 1 then theme_n = #themes end
|
|
|
|
if theme_n > #themes then theme_n = 1 end
|
|
|
|
window:set_config_overrides { color_scheme = themes[theme_n] }
|
|
|
|
end
|
2022-09-06 11:12:33 +03:00
|
|
|
|
2022-09-07 12:30:45 +03:00
|
|
|
function set_fontsize()
|
|
|
|
local execfile = os.getenv('WEZTERM_EXECUTABLE')
|
|
|
|
if string.match(execfile, 'MacOS') then return fontsize_darwin end
|
|
|
|
return fontsize_others
|
|
|
|
end
|
|
|
|
|
2022-09-06 11:12:33 +03:00
|
|
|
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)
|
2022-09-06 00:43:44 +03:00
|
|
|
wt.on('prev-theme', function(window) switch_theme(-1, window) end)
|
|
|
|
wt.on('next-theme', function(window) switch_theme( 1, window) end)
|
2022-09-06 11:12:33 +03:00
|
|
|
wt.on('reset-theme', function(window) window:set_config_overrides() end)
|
|
|
|
wt.on('webinar', function(window) window:set_config_overrides(webinar_overrides) end)
|
|
|
|
|
2022-09-03 19:30:19 +03:00
|
|
|
return {
|
2022-09-07 12:30:45 +03:00
|
|
|
font_size = set_fontsize(),
|
2022-09-03 19:30:19 +03:00
|
|
|
color_scheme = theme,
|
2022-09-06 11:12:33 +03:00
|
|
|
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,
|
|
|
|
},
|
2022-09-03 19:30:19 +03:00
|
|
|
keys = {
|
2022-09-06 00:43:44 +03:00
|
|
|
{ key = 'c', mods = 'META', action = wt.action.Copy },
|
2022-09-03 19:30:19 +03:00
|
|
|
{ key = 'v', mods = 'META', action = wt.action.Paste },
|
2022-09-06 00:43:44 +03:00
|
|
|
{ key = 'a', mods = 'META', action = wt.action.EmitEvent 'prev-theme' },
|
|
|
|
{ key = 's', mods = 'META', action = wt.action.EmitEvent 'next-theme' },
|
2022-09-06 11:12:33 +03:00
|
|
|
{ key = 'r', mods = 'META', action = wt.action.EmitEvent 'reset-theme' },
|
|
|
|
{ key = 'd', mods = 'META', action = wt.action.EmitEvent 'webinar' },
|
2022-09-03 19:30:19 +03:00
|
|
|
},
|
|
|
|
}
|