xbar
xbar copied to clipboard
Feature request - multiple lines in menu bar
Is it possible to display 2 or more lines of text in menu bar? Use case:
- Weather: City(normal text in one line) - High temperature/ Low temperature (two lines)
- Stock Quote: Ticker(normal text in one line) - Bid Ask price (two lines)
- Network monitoring: Up/Down(two lines)
Turn this
into this:
Mat would be able to explain it better, but right now this would require a non-negligible change to xbar, since there's already a convention for how to handle multi-line output from a plugin, to create the text that populates the drop-down portion for a displayed plugin. The output would need to be rendered differently, too, since right now it's just writing text to the menu bar, and stacking lines of text in the menu would probably require rendering the text as a small image and placing this into the menu bar, rather than just using text.
I could see how this would be useful. This isn't a comment on whether it's likely to be a feature that gets added; I'm mostly just thinking aloud about what would be required to make that happen.
+1 I would really like to be able to do this also.
Is the idea behind this that EG: "one|two|three" would be output on 3 distinct items (if we chose | as the split character) or 1 item that is 3 lines tall?
+1 for this, my bar is getting too crowded, this would be an amazing feature.
This would indeed be quite a wonderful addition. Just found this plugin and love iStat Menus way of displaying some information stacked. Not sure how it is done though — the idea with the rendered image could be close.
I actually was able to achieve something similar myself inside my script.
It's based on node-canvas and performs a speedtest so I know how fast my connection is at the moment.
Essentially an image is created and rendered to base64 which is then displayed in the menu bar.
I am not 100% happy at this point because node-canvas
I have not found a way how to create a higher DPI version of the image.
Additionally, I'd like to see xbar support plugins in a folder (https://github.com/matryer/xbar/issues/791) since that would make dependency management like node modules a bit easier and exchangeable.
I may end up putting the code for this script on GitHub in the future but right now it's just on my MacBook for testing 🙈.
Cheers and have a great weekend 🌸
I did push an initial release of my xbar plugin which does internet speed testing. But relevant to this conversation, it does render two lines in the menu bar by doing so in an image via node-canvas
.
Something to note about the image rendering is that, at least at the moment, it does not seem to render in retina. It's apparently 96dpi and is not possible to go any higher.
I am still trying to figure out how that may be adjusted / changed / improved (and I have seen one promising gist which may help with that). But as with many things: this will take time.
One more note: this is a workflow written 100% in node.js. This will not solve the long term problem / request of being able to show two lines in the menu bar… but it is a workaround which you may want to use for the time being.
https://github.com/chrisspiegl/xbar-internet-speedtest