repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

ui(wezterm): simplify workspace badges

8d5c8cd1932e2e0460b9a691fa026ff24a81c812

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

wezterm/bugabinga/status.lua

Modified
83 83 return ''
86 -local hex_to_rgb = function ( color )
87 - return tonumber( color:sub( 2, 3 ), 16 ),
88 - tonumber( color:sub( 4, 5 ), 16 ),
89 - tonumber( color:sub( 6, 7 ), 16 )
90 -end
92 -local mix_color = function ( a, b, t )
93 - local ar, ag, ab = hex_to_rgb( a )
94 - local br, bg, bb = hex_to_rgb( b )
95 - local blend = function ( x, y )
96 - return math.floor( x + (y - x) * t + 0.5 )
97 - end
98 - return string.format( '#%02x%02x%02x', blend( ar, br ), blend( ag, bg ), blend( ab, bb ) )
99 -end
101 86 local pulse_color = function ()
102 - local phase = (animation_tick % 24) / 24
103 - local eased = (1 - math.cos( phase * math.pi * 2 )) / 2
104 - return mix_color( palette.ui.minor, palette.ui.important_global, eased )
87 + return palette.ui.important_local
107 90 local busy_badge = function ()
225 208 table.insert( elements, { Foreground = { Color = fg } } )
226 209 if active then table.insert( elements, { Attribute = { Intensity = 'Bold' } } ) end
227 210 table.insert( elements, { Text = (active and ' ● ' or ' ○ ') .. short_workspace( summary.name ) } )
228 - colored_badge( elements, summary.badge, summary.badge_color, fg )
211 + if not active then
212 + colored_badge( elements, summary.badge, summary.badge_color, fg )
213 + end
229 214 if active and summary.tabs > 1 then
230 215 table.insert( elements, { Text = ' ' .. tostring( summary.tabs ) .. 't' } )