matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.58k stars 642 forks source link

Does it support background color using ANSI? #893

Open provCristianMaluenda opened 1 year ago

provCristianMaluenda commented 1 year ago

Hi, I am trying to set the background color using ANSI. The console looks fine, but xbar changes the color to the text and not the background. I am using Python3 and the code is like:

HEALTHY='\x1b[42m'
UNHEALTHY='\x1b[41m'
NC='\x1b[0m'

print(f'{HEALTHY}dev{NC}')

Console: image xbar shows the text blue instead of the background: image

I saw the example https://github.com/matryer/xbar/pull/703 but I can not find an example of a text with a colored background.

Thanks

rcheetah commented 2 months ago

I can replicate this on mac os 14.6.1 (23G93) and xbar v2.1.7-beta

I'm wondering too! For a plugin I would like to add a red background for the menu text if the plugin needs attention.

leaanthony commented 2 months ago

If you could try this PR then I'd be happy to merge it: https://github.com/matryer/xbar/pull/818

rcheetah commented 2 months ago

Thank you! Sadly I wasn't able to build it on my machine. I'm not a go dev and never used wails. Also I didn't find any documentation on how to build the app. I tried the build.sh in /app, but I got a build error:

xbar v2.1.7-beta-43-g8d0deba
          2024/09/09 11:39:16 open at login: app needs to be running as package.app file to start at login
          FATAL: This application was built using "go build". This is unsupported. Please compile using "wails build".

I'm stuck here and sadly I don't have the time to further dig into this. I'm hopeful somebody familiar in developing for mac os will test this PR.

leaanthony commented 2 months ago

If @matryer is ok for me to merge it, perhaps he could do another release?

matryer commented 2 months ago

Sure

leaanthony commented 2 months ago

Done!