MPRIS2 waybar component
Go to file
Harvey Tindall 49b3212c48
All checks were successful
continuous-integration/drone/push Build is passing
support multiple instances with different layouts
if specified layout for nth instance is different than 1st, the player data is
    shared instead of the waybar output.
2021-05-17 16:10:14 +01:00
dist update readme, mention AUR package 2021-01-16 17:03:48 +00:00
images update readme, mention AUR package 2021-01-16 17:03:48 +00:00
.drone.yml fix upload.py args for new version 2021-04-24 18:03:03 +01:00
.gitignore only share output when args are identical; use fixed length socket 2021-05-17 13:44:24 +01:00
.goreleaser.yml add drone/buildrone 2021-01-15 22:15:45 +00:00
go.mod overwrite previous content when sharing output 2021-04-24 16:02:39 +01:00
go.sum overwrite previous content when sharing output 2021-04-24 16:02:39 +01:00
LICENSE add license. 2021-02-13 22:28:30 +00:00
main.go support multiple instances with different layouts 2021-05-17 16:10:14 +01:00
README.md add PLAYER to --order, remove binary from repo 2021-05-16 23:28:23 +01:00

waybar-mpris

bar gif

Downloads:
binary | aur

a waybar component/utility for displaying and controlling MPRIS2 compliant media players individually, inspired by waybar-media.

MPRIS2 is widely supported, so this component should work with:

  • Chrome/Chromium
  • Firefox (Limited support with media.hardwaremediakeys.enabled = true in about:config)
  • Other browsers (using KDE Plasma Integration)
  • VLC
  • Spotify
  • Noson
  • mpd (with mpDris2)
  • Most other music/media players

Install

Available on the AUR as waybar-mpris-git (Thanks @nichobi!)

go get git.hrfee.pw/hrfee/waybar-mpris will compile from source and install.

You can also download a precompiled binary from here.

Issues

Stick them on mpris2client or the og repository (both on github) if you can't make an account here.

Usage

When running, the program will pipe out json in waybar's format. Add something like this to your waybar config.json:

"custom/waybar-mpris": {
    "return-type": "json",
    "exec": "waybar-mpris --position --autofocus",
    "on-click": "waybar-mpris --send toggle",
    // This option will switch between players on right click.
        "on-click-right": "waybar-mpris --send player-next",
    // The options below will switch the selected player on scroll
        // "on-scroll-up": "waybar-mpris --send player-next",
        // "on-scroll-down": "waybar-mpris --send player-prev",
    // The options below will go to next/previous track on scroll
        // "on-scroll-up": "waybar-mpris --send next",
        // "on-scroll-down": "waybar-mpris --send prev",
    "escape": true,
},
Usage of waybar-mpris:
      --autofocus          Auto switch to currently playing music players.
      --interpolate        Interpolate track position (helpful for players that don't update regularly, e.g mpDris2)
      --order string       Element order. (default "SYMBOL:ARTIST:ALBUM:TITLE:POSITION")
      --pause string       Pause symbol/text to use. (default "\uf8e3")
      --play string        Play symbol/text to use. (default "▶")
      --position           Show current position between brackets, e.g (04:50/05:00)
      --replace            Replace any running instances
      --send string        send command to already runnning waybar-mpris instance. (options: player-next/player-prev/next/prev/toggle)
      --separator string   Separator string to use between artist, album, and title. (default " - ")
  • Modify the order of components with --order. SYMBOL is the play/paused icon or text, POSITION is the track position (if enabled), other options are self explanatory.
  • --play/--pause specify the symbols or text to display when music is paused/playing respectively.
  • --separator specifies a string to separate the artist, album and title text.
  • --autofocus makes waybar-mpris automatically focus on currently playing music players.
  • --position enables the display of the track position.
  • --interpolate increments the track position every second. This is useful for players (e.g mpDris2) that don't regularly update the position.
  • --replace: By default, new instances will attach to the existing one so that the output is identical. This lets this instance replace any others running. It isn't recommended.
  • --send sends commands to an already running waybar-mpris instance via a unix socket. Commands:
    • player-next: Switch to displaying and controlling next available player.
    • player-prev: Same as player-next, but for the previous player.
    • next/prev: Next/previous track on the selected player.
    • toggle: Play/pause.
    • You can also bind these commands to Media keys in your WM config.