dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide CI runs wezterm: show workspace chips aab85db39f058368a388f3f6d9836d5b93a7e7a0
Oliver Krylow <o.krylow@isp-insoft.de > · 16 Jun 2026
unsigned
Browse files Compare with HEAD
Show all known workspaces in the left status line.
Render the active workspace as a bracketed full name and inactive workspaces as short slugs. Make the default workspace picker switch in the current window.
Changed files (2) Diff layout Auto Unified Split
wezterm/bugabinga/key_binds.lua Modified +2 / −2 text lines
213 213 key = 'z' , key = 'z' ,214 214 mods = 'LEADER' , mods = 'LEADER' ,215 - action = workspace_switcher.switch_workspace_in_new_window(),215 + action = workspace_switcher.switch_workspace(),218 218 key = 'Z' , key = 'Z' ,219 219 mods = 'LEADER|SHIFT' , mods = 'LEADER|SHIFT' ,220 - action = workspace_switcher.switch_workspace(),220 + action = workspace_switcher.switch_workspace_in_new_window(),223 223 key = 'k' , key = 'k' ,wezterm/bugabinga/status.lua Modified +30 / −3 text lines
27 27 if ok and config then use_palette_for_scheme( config.color_scheme ) end if ok and config then use_palette_for_scheme( config.color_scheme ) end 30 - local short_workspace = function ( name )30 + local short_workspace = function ( name, max_width )31 31 name = clean( name ) or 'default' name = clean( name ) or 'default' 32 32 local home = wez.home_dir local home = wez.home_dir33 33 if home and name:sub( 1 , # home ) == home then if home and name:sub( 1 , # home ) == home then 36 36 if name:find( '/' , 1 , true ) or name:find( '\\' , 1 , true ) then if name:find( '/' , 1 , true ) or name:find( '\\' , 1 , true ) then 37 37 name = basename( name ) or name name = basename( name ) or name39 - return wez.truncate_right( name, 18 )39 + return wez.truncate_right( name, max_width or 18 )42 + local workspace_slug = function ( name )43 + local slug = short_workspace( name ):gsub( '[^%w]' , '' ):sub( 1 , 3 ):lower()44 + return slug ~= '' and slug or '?' 47 + local workspace_chips = function ( active )48 + active = clean( active ) or 'default' 50 + local ok, names = pcall ( wez.mux.get_workspace_names )51 + if not ok or type ( names ) ~= 'table' or # names <= 1 then 52 + return short_workspace( active )55 + table .sort ( names, function ( a, b )56 + return tostring ( a ):lower() < tostring ( b ):lower()60 + for _, name in ipairs ( names ) do 61 + local label = workspace_slug( name )62 + if name == active then label = '[' .. short_workspace( name, 42 ) .. ']' end 63 + table .insert ( parts, label )66 + return table .concat ( parts, ' ' )42 69 local primary_pane = function ( tab )local primary_pane = function ( tab )149 176 local ok_domain, domain = pcall ( pane.get_domain_name, pane ) local ok_domain, domain = pcall ( pane.get_domain_name, pane )150 177 local domain_text, domain_icon, domain_color = domain_label( ok_domain and domain or nil ) local domain_text, domain_icon, domain_color = domain_label( ok_domain and domain or nil )151 - local workspace = short_workspace ( window:active_workspace() )178 + local workspace = workspace_chips ( window:active_workspace() )153 180 window:set_left_status( wez.format { window:set_left_status( wez.format {154 181 { Text = battery }, { Text = battery },