A module to display currently playing media in your Waybar.
Note
You're probably better off using Waybar's native MPRIS module rather than this custom one!
It does the same thing, and is way more customizable and robust.
Shows data from:
- Firefox, Google Chrome, Chromium and other browsers
- MPV
- Potentially, any other player with MPRIS support. Feel free to open an issue or a pull request!
The current title and artist are shown in the toolbar. Long titles/artists are ellipsized to 80 characters.
The tooltip displays more metadata, including the album and player name.
For Arch Linux, use the AUR package: waybar-media-git
You'll probably also want to install this, to get data from browsers: pacman -S plasma-browser-integration
If you can't use the AUR package, follow these steps:
- Install the Python packages listed in
requirements.txt(they should be available as a package from your distribution) - Put
waybar-media.pysomewhere in your $PATH - For browser integration, follow instructions from KDE Plasma Integration to install the native host and the browser extension(s). Note: KDE Plasma itself is not required.
Add to your Waybar configuration as a custom module, like so:
"custom/waybar-media": {
"return-type": "json",
"exec": "waybar-media.py status",
"on-click": "waybar-media.py playpause",
"on-scroll-up": "waybar-media.py previous",
"on-scroll-down": "waybar-media.py next",
"escape": true
}waybar-media.py always takes one argument. These are the available options:
status: Print the status in Waybar's JSON format.playpause: Toggle the state of the current player.previous: Go to the previous song.next: Go to the next song.
You may use the following classes to style the module:
playingpausedstopped
Here's an example to be placed in the styles.css file alongside the Waybar configuration. See Waybar's Styling docs for more ideas.
#custom-waybar-media.paused {
color: grey;
}The script is erroring out. Run waybar-media.py status directly in your terminal to see which errors show up.
The dependencies have not been installed. Check the installation instructions.
