2022-12-03 14:42:03 +01:00
|
|
|
local wezterm = require("wezterm")
|
2023-03-07 16:53:50 +01:00
|
|
|
local io = require("io")
|
|
|
|
local os = require("os")
|
2023-03-07 10:42:16 +01:00
|
|
|
local mux = wezterm.mux
|
|
|
|
local act = wezterm.action
|
2021-04-01 16:02:19 +02:00
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
local function font_with_fallback(name, params)
|
2023-03-07 10:42:16 +01:00
|
|
|
local names = { name, "Noto Color Emoji" }
|
2022-12-03 14:42:03 +01:00
|
|
|
return wezterm.font_with_fallback(names, params)
|
2021-04-01 16:02:19 +02:00
|
|
|
end
|
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
wezterm.on("gui-startup", function(cmd)
|
|
|
|
local tab, pane, window = mux.spawn_window(cmd or {})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
end)
|
|
|
|
|
2023-03-07 10:42:16 +01:00
|
|
|
wezterm.on("mux-startup", function()
|
|
|
|
local tab, pane, window = mux.spawn_window({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
window:spawn_tab({})
|
|
|
|
end)
|
2023-01-27 09:46:22 +01:00
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
local function scheme_for_appearance(appearance)
|
2023-03-07 10:42:16 +01:00
|
|
|
if appearance:find("Dark") then
|
|
|
|
return "Shelman Dark"
|
|
|
|
else
|
2023-03-07 16:53:50 +01:00
|
|
|
return "Shelman Light"
|
2023-03-07 10:42:16 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-03-07 16:53:50 +01:00
|
|
|
local function _get_scheme()
|
|
|
|
-- if wezterm.gui then
|
|
|
|
-- return return scheme_for_appearance(wezterm.gui.get_appearance())
|
|
|
|
-- end
|
|
|
|
return "Shelman Dark"
|
|
|
|
end
|
|
|
|
|
2023-03-07 10:42:16 +01:00
|
|
|
local is_server = wezterm.hostname() == "dln-dev"
|
2021-04-03 10:19:45 +02:00
|
|
|
|
2023-03-07 22:56:45 +01:00
|
|
|
wezterm.on("user-var-changed", function(window, pane, name, value)
|
|
|
|
wezterm.log_info("user-var-changed", name, value)
|
|
|
|
|
|
|
|
if name == "nvim_activate" then
|
|
|
|
for _, t in ipairs(window:mux_window():tabs_with_info()) do
|
|
|
|
for _, p in ipairs(t.tab:panes()) do
|
|
|
|
if p:get_title() == "nvim" then
|
|
|
|
window:perform_action(act.ActivateTab(t.index), p)
|
|
|
|
if t.index > 0 then
|
|
|
|
window:perform_action(act.MoveTab(0), p)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- window:perform_action(act.ActivateTab(0), pane)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2021-04-01 16:02:19 +02:00
|
|
|
return {
|
2023-03-07 16:53:50 +01:00
|
|
|
color_scheme = _get_scheme(),
|
2023-03-07 10:42:16 +01:00
|
|
|
color_scheme_dirs = { "/home/dln/.config/wezterm" },
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "Regular" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
font_rules = {
|
|
|
|
{
|
|
|
|
italic = false,
|
|
|
|
intensity = "Half",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "Thin" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
italic = true,
|
|
|
|
intensity = "Normal",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman Curly Slab", { weight = "Light", italic = true }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
italic = true,
|
|
|
|
intensity = "Bold",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS15", { weight = "ExtraLight", italic = true }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
intensity = "Bold",
|
2022-12-06 17:19:07 +01:00
|
|
|
font = font_with_fallback("Iosevka Shelman SS09", { weight = "DemiBold" }),
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
freetype_load_target = "Light",
|
2022-12-06 17:19:07 +01:00
|
|
|
freetype_render_target = "HorizontalLcd",
|
|
|
|
--freetype_load_flags = "NO_HINTING",
|
|
|
|
--custom_block_glyphs = false,
|
|
|
|
|
2022-12-03 14:42:03 +01:00
|
|
|
warn_about_missing_glyphs = false,
|
|
|
|
bold_brightens_ansi_colors = false,
|
2022-12-06 17:19:07 +01:00
|
|
|
allow_square_glyphs_to_overflow_width = "Always",
|
2023-03-07 10:42:16 +01:00
|
|
|
font_size = 13.5,
|
2022-12-06 17:19:07 +01:00
|
|
|
line_height = 1.0,
|
2023-03-07 10:42:16 +01:00
|
|
|
cell_width = 0.95,
|
|
|
|
-- initial_cols = 128,
|
|
|
|
-- initial_rows = 45,
|
|
|
|
use_resize_increments = true,
|
|
|
|
window_background_opacity = 1.0,
|
2023-01-27 09:46:22 +01:00
|
|
|
window_padding = {
|
2023-03-07 10:42:16 +01:00
|
|
|
left = "0.75cell",
|
|
|
|
right = "0.5cell",
|
|
|
|
top = "0.25cell",
|
|
|
|
bottom = "0cell",
|
|
|
|
},
|
|
|
|
colors = {
|
|
|
|
tab_bar = {
|
|
|
|
active_tab = {
|
|
|
|
fg_color = "#e0e0e0",
|
|
|
|
bg_color = "#374f66",
|
|
|
|
},
|
|
|
|
},
|
2023-01-27 09:46:22 +01:00
|
|
|
},
|
2022-12-06 17:19:07 +01:00
|
|
|
window_decorations = "RESIZE",
|
|
|
|
window_frame = {
|
|
|
|
border_left_width = "2px",
|
|
|
|
border_right_width = "2px",
|
|
|
|
border_bottom_height = "2px",
|
|
|
|
border_top_height = "2px",
|
2023-03-07 10:42:16 +01:00
|
|
|
border_left_color = "#333333",
|
|
|
|
border_right_color = "#333333",
|
|
|
|
border_bottom_color = "#333333",
|
|
|
|
border_top_color = "#333333",
|
|
|
|
inactive_titlebar_bg = "#21262e",
|
|
|
|
active_titlebar_bg = "#252b34",
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
|
|
|
default_cursor_style = "SteadyBlock",
|
|
|
|
cursor_thickness = "3px",
|
2023-01-27 09:46:22 +01:00
|
|
|
cursor_blink_rate = 300,
|
2022-12-03 14:42:03 +01:00
|
|
|
enable_wayland = true,
|
2023-03-07 23:04:13 +01:00
|
|
|
enable_tab_bar = false,
|
2022-12-03 14:42:03 +01:00
|
|
|
tab_bar_at_bottom = true,
|
2023-03-07 10:42:16 +01:00
|
|
|
use_fancy_tab_bar = true,
|
2022-12-03 14:42:03 +01:00
|
|
|
show_tab_index_in_tab_bar = true,
|
|
|
|
enable_scroll_bar = false,
|
|
|
|
scrollback_lines = 5000,
|
|
|
|
alternate_buffer_wheel_scroll_speed = 2,
|
|
|
|
check_for_updates = false,
|
|
|
|
status_update_interval = 100,
|
|
|
|
audible_bell = "Disabled",
|
|
|
|
term = "wezterm",
|
|
|
|
disable_default_key_bindings = true,
|
|
|
|
keys = {
|
2023-03-07 10:42:16 +01:00
|
|
|
{ key = "c", mods = "ALT|SHIFT", action = act({ CopyTo = "ClipboardAndPrimarySelection" }) },
|
2022-12-03 14:42:03 +01:00
|
|
|
{ key = "v", mods = "ALT|SHIFT", action = "Paste" },
|
|
|
|
{ key = "0", mods = "CTRL", action = "ResetFontSize" },
|
|
|
|
{ key = "-", mods = "CTRL", action = "DecreaseFontSize" },
|
|
|
|
{ key = "=", mods = "CTRL", action = "IncreaseFontSize" },
|
|
|
|
{ key = "Enter", mods = "ALT", action = "ToggleFullScreen" },
|
2023-03-07 10:42:16 +01:00
|
|
|
{ key = "r", mods = "ALT", action = act.ReloadConfiguration },
|
|
|
|
-- mux
|
|
|
|
{ key = "E", mods = "CTRL|SHIFT", action = act.DetachDomain({ DomainName = "dln-dev" }) },
|
|
|
|
{ key = "1", mods = "ALT", action = act({ ActivateTab = 0 }) },
|
|
|
|
{ key = "2", mods = "ALT", action = act({ ActivateTab = 1 }) },
|
|
|
|
{ key = "3", mods = "ALT", action = act({ ActivateTab = 2 }) },
|
|
|
|
{ key = "4", mods = "ALT", action = act({ ActivateTab = 3 }) },
|
|
|
|
{ key = "5", mods = "ALT", action = act({ ActivateTab = 4 }) },
|
|
|
|
{ key = "6", mods = "ALT", action = act({ ActivateTab = 5 }) },
|
|
|
|
{ key = "7", mods = "ALT", action = act({ ActivateTab = 6 }) },
|
|
|
|
{ key = "8", mods = "ALT", action = act({ ActivateTab = 7 }) },
|
|
|
|
{ key = "9", mods = "ALT", action = act({ ActivateTab = 8 }) },
|
2023-03-07 22:56:45 +01:00
|
|
|
{ key = "0", mods = "ALT", action = act({ ActivateTab = 9 }) },
|
|
|
|
{ key = "RightArrow", mods = "CTRL", action = act.ActivateTabRelative(1) },
|
|
|
|
{ key = "LeftArrow", mods = "CTRL", action = act.ActivateTabRelative(-1) },
|
2023-03-07 10:42:16 +01:00
|
|
|
},
|
|
|
|
unix_domains = {
|
|
|
|
{
|
|
|
|
name = "dln-dev",
|
|
|
|
local_echo_threshold_ms = 100,
|
2023-03-07 16:53:50 +01:00
|
|
|
proxy_command = is_server == false and { "ssh", "dln-dev", "wezterm", "cli", "proxy" } or nil,
|
2023-03-07 10:42:16 +01:00
|
|
|
},
|
2022-12-03 14:42:03 +01:00
|
|
|
},
|
2021-04-01 16:02:19 +02:00
|
|
|
}
|