Sometimes I want to have a persistent notification or indicator generated by Keyboard Maestro. I might use this to have an alert, show that a macro is running, or anything else.
I've started using BitBar for this purpose. BitBar just runs shell scripts and displays their output in your menu bar.
To support this, I've added a this script to my bitbar plugins. It simply concatenates all variables that begin with "bitbar__" and puts them in the menu. I then make heavy use of emoji and custom unicode characters to give myself small notifications in the menu bar.
You can do a lot more with BitBar, but this is quick, easy, and fits nicely into any KM macro since it can pull in any number of variables. And if there's no variables of the right name, it just displays nothing.
I think this is going to work for my needs! Here's what I did:
I installed BitBar, and selected (created) a folder for the plugins. I put them in Documents/BitBar/Plugins.
I put iNik's applescript in the Plugins folder, but I renamed it to "kmstatus.1d.applescript" so it only runs once a day (I'll explain below).
I created this test macro:
Works great! Setting the variable to an empty string clears the text from the menu bar, but I think there's a slight bug because the icon does't slide over. But if you hover over it, it does, so no biggie.
I have a few things I like to toggle on or off as I need them, and this will tell me at a glance what their state is. Awesome!
Ooh! I didn’t see how easy it was to refresh BitBar manually. That’s a
great little improvement!
The resource hit is low enough that it’s probably fine to check all the
time, but your method will refresh immediately when it needs to, and is
more elegant.
@peternlewis - I’m not the expert here, but I don’t think BitBar supports that, when “terminal=false” is used. I think it’s a bug. @iNik could answer better.
Peter, it would be really cool if KM supported doing things like this. I suspect it wouldn’t be high on your enhancement list, especially since BitBar can do it. However, it has to intrigue your inner geek/propellerhead, right? Can’t help yourself, right?
@peternlewis It requires triggered scripts to be bash one liners, and the way it parses it out doesn’t seem to be friendly to escaped quotes and stuff that AppleScript/osascript demands.
There’s no reason why the plugin itself couldn’t be an AppleScript, but it would still need to output a bash command.
Hey Dan, it's been a long time that you are using BitBar. I'd like to hear from you if BitBar easy to work with. And if it's possible give us a few examples of what you do with. Ty