Build Monitoring Widgets with Ruby and BitBar

Originally published at:

Ruby developers are used to finding incredibly useful open source projects packaged as gems. In this tutorial, we’ll take a look at BitBar, an open source project that isn’t built in Ruby, but when combined with a small bit of Ruby can be incredibly powerful.

While the original project is no longer actively maintained, an updated fork of the project can be found here:

BitBar provides Mac OS X users an easy way to create a menu bar item from the standard output of a script. I’ll show you how to create a simple site ping monitor, and then we’ll create a Twitter follower counter.

Installing BitBar

To install BitBar, visit the GitHub repository at Download the zip file (the button to download is in the righthand sidebar). Inside the archived folder, you will find a “Releases” folder, which holds the file. Put this in your Applications directory. Opening this application launches BitBar.

How BitBar Works: File Structure

BitBar is a simple application that runs all shell scripts in a given directory on an interval that is determined by the filename. Of course, you should be very careful when adding scripts to BitBar, especially if you are adding a low interval time.

To run a given file every 5 minutes, the naming structure would look something like this:

Continue reading this article on SitePoint

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.