diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2025-08-04 16:53:40 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-07-01 00:23:31 -0400 |
| commit | 0d6f8ce5ccd223d324e006ce0f0cff7e0474adee (patch) | |
| tree | d18a701b4de22be54e490ead45bc39b450ad1f07 /dot_config | |
| parent | b276fac5929773ae73a9a4569feaf58ec0d41dd5 (diff) | |
feat(wezterm): small tweaks from work
Diffstat (limited to 'dot_config')
| -rw-r--r-- | dot_config/wezterm/tabs.lua | 79 | ||||
| -rw-r--r-- | dot_config/wezterm/wezterm.lua | 10 |
2 files changed, 64 insertions, 25 deletions
diff --git a/dot_config/wezterm/tabs.lua b/dot_config/wezterm/tabs.lua index 53c5548..49e570e 100644 --- a/dot_config/wezterm/tabs.lua +++ b/dot_config/wezterm/tabs.lua @@ -1,24 +1,61 @@ local wezterm = require("wezterm") -local M = { - tab_bar_style = { - active_tab_left = wezterm.format({ - { Background = { Color = "#3c3836" } }, - { Foreground = { Color = "#ebdbb2" } }, - }), - active_tab_right = wezterm.format({ - { Background = { Color = "#3c3836" } }, - { Foreground = { Color = "#ebdbb2" } }, - }), - inactive_tab_left = wezterm.format({ - { Background = { Color = "#665c34" } }, - { Foreground = { Color = "#bdae93" } }, - }), - inactive_tab_right = wezterm.format({ - { Background = { Color = "#665c34" } }, - { Foreground = { Color = "#bdae93" } }, - }), - }, -} +-- The filled in variant of the < symbol +local SOLID_LEFT_ARROW = wezterm.nerdfonts.pl_right_hard_divider -return M +-- The filled in variant of the > symbol +local SOLID_RIGHT_ARROW = wezterm.nerdfonts.pl_left_hard_divider + +-- This function returns the suggested title for a tab. +-- It prefers the title that was set via `tab:set_title()` +-- or `wezterm cli set-tab-title`, but falls back to the +-- title of the active pane in that tab. +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 edge_background = '#0b0022' + local background = '#1b1032' + local foreground = '#808080' + + if tab.is_active then + background = '#2b2042' + foreground = '#c0c0c0' + elseif hover then + background = '#3b3052' + foreground = '#909090' + end + + local edge_foreground = background + + local title = tab_title(tab) + + -- ensure that the titles fit in the available space, + -- and that we have room for the edges. + title = wezterm.truncate_right(title, max_width - 2) + + return { + { Background = { Color = edge_background } }, + { Foreground = { Color = edge_foreground } }, + { Text = SOLID_LEFT_ARROW }, + { Background = { Color = background } }, + { Foreground = { Color = foreground } }, + { Text = title }, + { Background = { Color = edge_background } }, + { Foreground = { Color = edge_foreground } }, + { Text = SOLID_RIGHT_ARROW }, + } + end +) + +return {} diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua index c0a57ae..ef2585b 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/dot_config/wezterm/wezterm.lua @@ -26,11 +26,13 @@ local config = { initial_rows = length, -- TODO: Create custom color scheme in separate module (colors.lua) color_scheme = "rose-pine", - -- window_background_opacity = 0.9, + window_background_opacity = 0.7, + -- window_decorations = "NONE | RESIZE", - use_fancy_tab_bar = false, - show_tabs_in_tab_bar = true, - show_new_tab_button_in_tab_bar = false, + enable_tab_bar = false, + -- use_fancy_tab_bar = false, + -- show_tabs_in_tab_bar = false, + -- show_new_tab_button_in_tab_bar = false, -- tab_bar_style = tabs.tab_bar_style, default_prog = { chezmoi.shell }, |
