Add info to Dock/Menubar from Shell in macOSX
I'm working on MacOSX environnement, but I would like to tweak it a bit. I have a few bash scripts I used in Linux to retrieve infos such as IP, average ping and so, that I would like to be displayed in a persistant place. (I.E. the doc, or the menu bar).
I did not found any documentation on this topic, can someone provide a few link or the name of the correct man page to read about that?
thanks
Solution 1:
The Dock and menu bar are both for use by applications only. Dock icons are managed by the NSDockTile
class, and items on the right side of the menu bar are managed by NSStatusItem
. If you want to display this information in one of those places, you'll have to create an application to do so. (If you can't convert your bash scripts to C/Obj-C, you can use NSTask
to run them.)
Solution 2:
I just found this: https://github.com/stretchr/bitbar. Works like a charm.