cornflake/home-manager/wezterm/wezterm.lua
2026-01-04 01:49:46 +09:00

89 lines
2.3 KiB
Lua

local wezterm = require 'wezterm'
local config = {
enable_wayland = true,
force_reverse_video_cursor = true,
font_size = 12,
colors = {
foreground = '#dcd7ba',
background = 'rgba(31,31,31,0.2)',
cursor_bg = '#c8c093',
cursor_fg = '#c8c093',
cursor_border = '#c8c093',
selection_fg = '#c8c093',
selection_bg = '#2d4f67',
scrollbar_thumb = '#16161d',
split = '#16161d',
ansi = { '#090618', '#c34043', '#76946a', '#c0a36e', '#7e9cd8', '#957fb8', '#6a9589', '#c8c093' },
brights = { '#727169', '#e82424', '#98bb6c', '#e6c384', '#7fb4ca', '#938aa9', '#7aa89f', '#dcd7ba' },
indexed = { [16] = '#ffa066', [17] = '#ff5d62' },
tab_bar = {
background = 'rgba(31, 31, 40, 0.5)',
new_tab = {
bg_color = 'rgba(31, 31, 40, 0.5)',
fg_color = '#c8c093',
},
new_tab_hover = {
bg_color = 'rgba(31, 31, 40, 0.5)',
fg_color = '#c8c093',
intensity = 'Bold'
},
}
},
use_fancy_tab_bar = false,
show_tab_index_in_tab_bar = false,
keys = {
{ key = 'V', mods = 'CTRL', action = wezterm.action.PasteFrom 'Clipboard' },
}
}
local SOLID_LEFT_ARROW = wezterm.nerdfonts.pl_right_hard_divider
local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider
function tab_title(tab_info)
local title = tab_info.tab_title
-- if the tab title is explicitly set, take that
if title and #title > 0 then
return title
end
-- Otherwise, use the title from the active pane
-- in that tab
return tab_info.active_pane.title
end
wezterm.on(
'format-tab-title',
function(tab, tabs, panes, config, hover, max_width)
local bg_color = 'rgba(31, 31, 40, 0.5)'
local fg_color = '#c8c093'
local text_color = '#1f1f28'
if tab.is_active then
fg_color = '#2d4f67'
text_color = '#c8c093'
end
local title = wezterm.truncate_right(tab_title(tab), max_width - 4)
return {
{ Background = { Color = bg_color } },
{ Foreground = { Color = fg_color } },
{ Text = SOLID_LEFT_ARROW },
{ Background = { Color = fg_color } },
{ Foreground = { Color = text_color } },
{ Text = ' ' .. title .. ' ' },
{ Background = { Color = bg_color } },
{ Foreground = { Color = fg_color } },
{ Text = SOLID_RIGHT_ARROW },
}
end
)
return config