meta_package_manager.bitbar - BitBar plugin

Bitbar plugin for Meta Package Manager (a.k.a. the mpm CLI).

Default update cycle is set to 7 hours so we have a chance to get user’s attention once a day. Higher frequency might ruin the system as all checks are quite resource intensive, and Homebrew might hit GitHub’s API calls quota.

Minimal BitBar requirement is Mac OS X Lion (10.7), which ships with Python 2.7.1. So this plugin is supposed to support Python 2.7.1 or newer.

meta_package_manager.bitbar.SUBMENU_LAYOUT = False

Define the rendering mode of outdated packages list.

Edit this script to force this constant to True, or use the BITBAR_MPM_SUBMENU environment variable. This will replace the default flat layout with an alternative structure where all upgrade actions are put into submenus, one for each manager.


Tweak environment variable to find non-default system-wide binaries.

macOS does not put /usr/local/bin or /opt/local/bin in the PATH for GUI apps. For some package managers this is a problem. Additioanlly Homebrew and Macports are using different pathes. So, to make sure we can always get to the necessary binaries, we overload the path. Current preference order would equate to Homebrew, Macports, then system.*args)[source]

Run a shell command, return error code, output and error message.


Print message to the output.

Not unlike click.echo(), this method is required to support discrepencies in the way strings are handled in different Python versions and platforms.


Generic header for blockng error.

meta_package_manager.bitbar.print_error(message, submenu='')[source]

Print a formatted error line by line.

A red, fixed-width font is used to preserve traceback and exception layout.


Print two CLI entries: * one that is silent * a second one that is the exact copy of the above but forces the execution

by the way of a visible terminal

meta_package_manager.bitbar.print_package_items(packages, submenu='')[source]

Print a menu entry for each outdated packages available for upgrade.

meta_package_manager.bitbar.print_upgrade_all_item(manager, submenu='')[source]

Print the menu entry to upgrade all outdated package of a manager.


Print menu structure using BitBar’s plugin API.