dotfiles
bugabingas dorkfiles
owned by bugabinga
ui(wezterm): simplify workspace badges
13b421e08b2931f7dd0e4e767bfe01f3d00b067a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (1)
wezterm/bugabinga/status.lua
Modified 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 )
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 )
98 - return string.
format(
'#%02x%02x%02x', blend( ar, br ), blend( ag, bg ), blend( ab, bb ) )
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 )
212 + colored_badge( elements, summary.badge, summary.badge_color, fg )
229 214 if active
and summary.tabs
> 1 then 230 215 table.
insert( elements, {
Text =
' ' .. tostring( summary.tabs )
.. 't' } )