xbar icon indicating copy to clipboard operation
xbar copied to clipboard

Background colors from bitbar plugins do not work

Open ahmetb opened this issue 3 years ago • 8 comments

v2.1.7-beta

Repro: https://xbarapp.com/docs/plugins/Dev/Tutorial/ansi.sh.html

renders as image

but it should render as image

another repro is at https://github.com/ahmetb/dotfiles/blob/master/bitbar-plugins/yahoo_stock_ticker.1m.py renders as

image

whereas bitbar renders this as image

ahmetb avatar Nov 17 '21 18:11 ahmetb

Hmmm...there must be something up with the ANSI parser. I'll take a look.

leaanthony avatar Nov 18 '21 08:11 leaanthony

Any love for this issue? 😇

ahmetb avatar Feb 24 '22 03:02 ahmetb

Thanks for the ping! I'll have a quick peek tonight

leaanthony avatar Feb 24 '22 08:02 leaanthony

If you need a repro: https://github.com/ahmetb/dotfiles/blob/master/bitbar-plugins/yahoo_stock_ticker.1m.py

ahmetb avatar Feb 24 '22 18:02 ahmetb

Thanks. This'll be the weekend now. It looks like a parse error so I'll need to create a test case out of this for https://github.com/leaanthony/go-ansi-parser

leaanthony avatar Feb 24 '22 19:02 leaanthony

@ahmetb - after more looking at this, it seems bitbar didn't render it correctly anyway. [40m should be black, not grey. I'm also reading that [1m (bold) should be interpreted as "high intensity" so it would make the colours brighter. Running this script in a terminal seems to set it to intense colours by default, which is weird.

I've fixed a small parse error which cleared it all up: image

I believe, based on what I'm reading in the standards, this is the correct output for those codes. If you disagree and have more insights, please let me know. Cheers.

leaanthony avatar Feb 26 '22 10:02 leaanthony

Should also mention that the bitbar rendering of the yahoo finance plugin in this thread is also a bit off. The screenshot on the plugin page looks like there are no background colours: https://xbarapp.com/docs/plugins/Finance/yahoo_stock_ticker.10m.py.html

leaanthony avatar Feb 26 '22 10:02 leaanthony

I have customized it. I recommend trying with the link I provided.

ahmetb avatar Feb 26 '22 17:02 ahmetb