Plex What's Playing Plugin for BitBar

This is a Bitbar plugin that I wrote that shows you what’s currently playing on your Plex Media server.

BitBar Plex


This plugin / script uses bash. Additionally you’ll need the following packages installed:

  • Imagemagick: used for the mogrify command.
  • base64: used to convert image into a format BitBar can handle easily
  • curl: used to make API calls to Plex

To see if you have these installed, open a terminal in OS X and run:

which mogrify
which base64
which curl
which ping

On my Macbook, these files are:

- /usr/local/bin/mogrify
- /usr/bin/base64
- /usr/bin/curl
- /bin/ping

Adjust these paths if necessary. If you don’t have these programs, you can install them using brew: brew install <app name>.


Install into your Bitbar plugin directory. Update the environment variables for your configuration. The pinghost variable can be the same as the plexhost variable (presuming the server is pingable).


Update the values in the plugin as follows:

Rename the plugin to adjust how frequently it refreshes. I don’t recommend setting too low of a refresh rate, but your usage may vary. The default is 1 minute, hence the .1m. in the filename.

  • The pinghost value is used to see if the Plex host server is up. It is mostly used for laptops where networks can change. The script won’t attempt to curl the Plex identity if the host is unreachable. If your Plex server isn’t pingable, this value can changed to any other pingable host on your network.
  • The plexhost value is the hostname or IP address of your Plex server.
  • The plextoken value is your Plex authentication token. You can see how to get it here
  • The serverid value is your local Plex server’s UUID. You can find it in the address bar. In this example, it’s 867c53098dc5feccea1cb108c18448cd6af92:

serverid is in the address bar on a detail page


If you have problems or bitbar doesn’t respond, kill the process. Find the process ID with:

$ ps aux | grep -i bitbar | egrep -v grep
username 1993 0.0 0.2 5116184 35752 ?? S Mon02PM 2:14.61 /Applications/

Now kill the process ID, in this case 1993:

$ kill -9 1993

Move the plugins out of the plugin directory and restart Bitbar. Replace the plugins back into the plugin directory until you find the one causing a problem.

To Do

  • Add support for Music
  • Display currently playing Trailer
  • Clean up the code
  • Possibly rewrite the code (python)


Join the conversation with plugin authors and BitBar maintainers on Slack

Plex is registered trademark of Plex.


Chris Bergeron

Posted on


Updated on


Licensed under