matryer / xbar

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

Text after embedded image won't display #425

Closed frakman1 closed 7 years ago

frakman1 commented 7 years ago

(I am using python for a plugin and latest BitBar on Mac running Sierra 10.12.5)

Using the following code works:

imsgicon="iVBORw0..."
print "|image="+str(imsgicon).encode("utf-8") 

and yields: image

But then I add some text after it and it won't show up. I get the exact same result as before.

imsgicon="iVBORw0..."
print "|image="+str(imsgicon).encode("utf-8") + "Text Here" 

Where did the text go?

iosdeveloper commented 7 years ago

Put the text before the | or after a newline.

frakman1 commented 7 years ago

Interesting.

Put the text before the |

I would never have thought of that since that would imply that the text came first. But that worked! Thank you!

So, using this form:

print "Text Here|image="+str(imsgicon).encode("utf-8") 

results in:

image

Which seems backwards. However,

or after a newline.

That definitely puts it on the next line which is not what the intent was. The desire (in this case) is to put the image first, with the text along side it. Putting text after the new line like this:

print "|image="+str(imsgicon).encode("utf-8") +"\n Text Here"
#is this what you meant?

results in:

image

So how does this work? What if:

The order things go in is not intuitive (at least not to me) and the instructions are not unambiguously clear.

iosdeveloper commented 7 years ago

Images can only appear to the left. You can use an icon font or emojis for inline.

frakman1 commented 7 years ago

Ah. Thank you for clearing that up. That is definitely not documented.