wezterm: better status for wsl and host
67ed529c3380c894164883106ded6ec078fc36d8
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
- Parent 1: 731dfbd85168
bugabingas dorkfiles
67ed529c3380c894164883106ded6ec078fc36d8
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
+53 / −27 text lines
+53 / −27 text lines
local nerd_icon = function ( fallback, ... ) for _, name in ipairs { ... } do if wez.nerdfonts[name] then return wez.nerdfonts[name] end end return fallbackendlocal host_domain = function () local triple = wez.target_triple or '' if triple:find( 'windows', 1, true ) then return 'WIN', nerd_icon( '□', 'dev_windows', 'md_microsoft_windows', 'cod_terminal_powershell' ), palette.warning elseif triple:find( 'darwin', 1, true ) then return 'MAC', nerd_icon( '□', 'dev_apple', 'fa_apple' ), palette.ui.important_local elseif triple:find( 'linux', 1, true ) then return 'LIN', nerd_icon( '□', 'dev_linux', 'cod_terminal_linux' ), palette.ui.important_local elseif triple:find( 'bsd', 1, true ) then return 'BSD', nerd_icon( '□', 'dev_freebsd' ), palette.ui.important_local end return 'LOC', nerd_icon( '□', 'cod_terminal' ), palette.ui.important_localend local label, icon, color label = domain:gsub( '^WSL:', 'WSL ' ) if key_table or leader then local mode_text = key_table or 'LEADER' right_elements = { { Background = { Color = palette.error } }, { Foreground = { Color = palette.ui.backdrop } }, { Attribute = { Intensity = 'Bold' } }, { Text = ' ' .. mode_text .. ' ' }, 'ResetAttributes', { Text = ' ' }, } end local left_elements = {} if key_table or leader then local mode_text = key_table or 'LEADER' left_elements = { { Background = { Color = palette.error } }, { Foreground = { Color = palette.ui.backdrop } }, { Attribute = { Intensity = 'Bold' } }, { Text = ' ' .. mode_text .. ' ' }, 'ResetAttributes', { Text = ' ' }, } else left_elements = { { Text = battery_icons }, } for _, element in ipairs( workspace_hud( current_workspace ) ) do table.insert( left_elements, element ) end for _, element in ipairs( domain_hud( pane_domain ) ) do table.insert( left_elements, element ) end