Yeah hammerspoon rocks and is very lightweight and easy to use... This simple example shows how powerful it is for automation:<p><a href="http:&#x2F;&#x2F;www.hammerspoon.org&#x2F;go&#x2F;#simplemenubar" rel="nofollow">http:&#x2F;&#x2F;www.hammerspoon.org&#x2F;go&#x2F;#simplemenubar</a><p><pre><code>  -- 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&#x27;re going to use two of Hammerspoon&#x27;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(&quot;AWAKE&quot;)
      else
          caffeine:setTitle(&quot;SLEEPY&quot;)
      end
  end

  function caffeineClicked()
      setCaffeineDisplay(hs.caffeinate.toggle(&quot;displayIdle&quot;))
  end

  if caffeine then
      caffeine:setClickCallback(caffeineClicked)
      setCaffeineDisplay(hs.caffeinate.get(&quot;displayIdle&quot;))
  end</code></pre>