4 ms·
Could also use Hammerspoon (http://www.hammerspoon.org/ http://www.hammerspoon.org/) for this. It uses Lua but you can invoke processes and modify the toolbar.
by javajosh 11y ago
Could also use Hammerspoon (http://www.hammerspoon.org/ http://www.hammerspoon.org/) for this. It uses Lua but you can invoke processes and modify the toolbar. In addition you can hook into keystrokes, do window management, and all kinds of stuff.
- cmsj 11y agoand the upcoming 0.9.44 release will be even more flexible for this sort of use, because the process invoking stuff (http://www.hammerspoon.org/docs/hs.task.html http://www.hammerspoon.org/docs/hs.task.html ) will support processes that run indefinitely, so you could do crazy stuff like have a menubar item that shows the most recent line of a log file, or whatever you want :)
- hipjiveguy 11y agoYeah hammerspoon rocks and is very lightweight and easy to use... This simple example shows how powerful it is for automation: http://www.hammerspoon.org/go/#simplemenubar http://www.hammerspoon.org/go/#simplemenubar -- Creating a simple menubar item -- Lots of Mac utilities place a small icon in the system menubar to display their -- status and let you interact with them. We're going to use two of Hammerspoon's -- extensions to whip up a very simple replacement for the popular utility Caffeine. local caffeine = hs.menubar.new() function setCaffeineDisplay(state) if state then caffeine:setTitle("AWAKE") else caffeine:setTitle("SLEEPY") end end function caffeineClicked() setCaffeineDisplay(hs.caffeinate.toggle("displayIdle")) end if caffeine then caffeine:setClickCallback(caffeineClicked) setCaffeineDisplay(hs.caffeinate.get("displayIdle")) end