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.
Requirements
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:
1 | which mogrify |
On my Macbook, these files are:
1 | - /usr/local/bin/mogrify |
Adjust these paths if necessary. If you don’t have these programs, you can install them using brew
: brew install <app name>
.
Usage
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).
Configuration
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’s867c53098dc5feccea1cb108c18448cd6af92
:
Troubleshooting
If you have problems or bitbar doesn’t respond, kill the BitBar.app process. Find the process ID with:
1 | $ ps aux | grep -i bitbar | egrep -v grep |
Now kill the process ID, in this case 1993
:
1 | $ 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)
Misc
Join the conversation with plugin authors and BitBar maintainers on Slack
Plex is registered trademark of Plex.
Plex What's Playing Plugin for BitBar
https://chrisbergeron.com/2019/02/19/Plex-What-s-Playing-Plugin-for-BitBar/