this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(wezterm): Tmux-like tabbar (wip)

+83 -1
+83 -1
wezterm/wezterm.lua
··· 1 1 local wezterm = require 'wezterm' 2 + 3 + local function get_process(tab) 4 + local process_icons = { 5 + ["fish"] = { 6 + { Text = wezterm.nerdfonts.mdi_fish }, 7 + }, 8 + ["docker"] = { 9 + { Text = wezterm.nerdfonts.linux_docker }, 10 + }, 11 + ["nvim"] = { 12 + { Text = wezterm.nerdfonts.custom_vim }, 13 + }, 14 + ["vim"] = { 15 + { Text = wezterm.nerdfonts.dev_vim }, 16 + }, 17 + ["node"] = { 18 + { Text = wezterm.nerdfonts.mdi_hexagon }, 19 + }, 20 + ["go"] = { 21 + { Text = wezterm.nerdfonts.mdi_language_go }, 22 + }, 23 + ["cargo"] = { 24 + { Text = wezterm.nerdfonts.dev_rust }, 25 + }, 26 + ["lua"] = { 27 + { Text = wezterm.nerdfonts.seti_lua }, 28 + }, 29 + ["wget"] = { 30 + { Text = wezterm.nerdfonts.mdi_arrow_down_box }, 31 + }, 32 + ["curl"] = { 33 + { Text = wezterm.nerdfonts.mdi_flattr }, 34 + }, 35 + ['lazygit'] = { 36 + { Text = wezterm.nerdfonts.dev_git }, 37 + }, 38 + } 39 + 40 + local process_name = string.gsub(tab.active_pane.foreground_process_name, "(.*[/\\])(.*)", "%2") 41 + 42 + return wezterm.format(process_icons[process_name] 43 + or { 44 + { Text = string.format('[%s]', process_name) } 45 + }) 46 + end 47 + 48 + local function get_current_working_dir(tab) 49 + local current_dir = tab.active_pane.current_working_dir 50 + local HOME_DIR = string.format("file://%s", os.getenv("HOME")) 51 + return current_dir == HOME_DIR and "  ~" 52 + or string.format("  %s", string.gsub(current_dir, "(.*[/\\])(.*)", "%2")) 53 + end 54 + 55 + wezterm.on( 56 + 'format-tab-title', 57 + function(tab, _tabs, _panes, _config, hover, _max_width) 58 + local background = '#1b1032' 59 + local foreground = '#c0c0c0' 60 + if tab.is_active then 61 + local tmp = background 62 + background = foreground 63 + foreground = tmp 64 + elseif hover then 65 + background = '#3b3052' 66 + foreground = '#909090' 67 + end 68 + 69 + return wezterm.format({ 70 + { Foreground = { Color = foreground } }, 71 + { Background = { Color = background } }, 72 + { Text = string.format(' %s ', tab.tab_index + 1) }, 73 + { Text = get_process(tab) }, 74 + { Text = " " }, 75 + { Text = get_current_working_dir(tab) }, 76 + { Text = ' ▕' }, 77 + }) 78 + end 79 + ) 80 + 2 81 return { 3 82 font = wezterm.font_with_fallback { 4 83 'Fira Code', ··· 37 116 }, 38 117 line_height = 1.2, 39 118 allow_square_glyphs_to_overflow_width = "Always", 40 - hide_tab_bar_if_only_one_tab = true, 119 + hide_tab_bar_if_only_one_tab = false, 120 + use_fancy_tab_bar = false, 121 + tab_bar_at_bottom = true, 122 + tab_max_width = 50, 41 123 adjust_window_size_when_changing_font_size = false, 42 124 window_padding = { 43 125 top = 0,