dotfiles/.wezterm.lua

59 lines
1.6 KiB
Lua

-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This will hold the configuration.
local config = wezterm.config_builder()
function scheme_for_appearance(appearance)
if appearance:find 'Dark' then
return 'Catppuccin Mocha'
else
return 'Catppuccin Latte'
end
end
local act = wezterm.action
local config = wezterm.config_builder()
config.keys = {
{
key = 'E',
mods = 'CTRL|SHIFT',
action = act.PromptInputLine {
description = 'Enter new name for tab',
action = wezterm.action_callback(function(window, pane, line)
-- line will be `nil` if they hit escape without entering anything
-- An empty string if they just hit enter
-- Or the actual line of text they wrote
if line then
window:active_tab():set_title(line)
end
end),
},
},
}
wezterm.on('window-config-reloaded', function(window, pane)
local overrides = window:get_config_overrides() or {}
local appearance = window:get_appearance()
local scheme = scheme_for_appearance(appearance)
if overrides.color_scheme ~= scheme then
overrides.color_scheme = scheme
window:set_config_overrides(overrides)
end
end)
-- This is where you actually apply your config choices
-- For example, changing the color scheme:
-- config.color_scheme = 'AdventureTime'
config.font = wezterm.font 'Victor Mono'
config.font_size = 14
config.window_background_opacity = 0.90
config.macos_window_background_blur = 20
config.use_fancy_tab_bar = false
config.hide_tab_bar_if_only_one_tab = true
config.window_decorations = "RESIZE"
-- and finally, return the configuration to wezterm
return config