diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 52 |
1 files changed, 46 insertions, 6 deletions
@@ -1,22 +1,62 @@ ## waybar-mpris +<p> + <img src="images/cropped.gif" style="width: 100%;" alt="bar gif"></img> +</p> -a custom waybar component for displaying info from MPRIS2 players. It automatically focuses on currently playing music players, and can easily be customized. +a waybar component/utility for displaying and controlling MPRIS2 compliant media players individually, inspired by [waybar-media](https://github.com/yurihs/waybar-media). + +MPRIS2 is widely supported, so this component should work with: +* Chrome/Chromium +* Other browsers (with kde plasma integration installed) +* VLC +* Spotify +* Noson +* mpd (with [mpDris2](https://github.com/eonpatapon/mpDris2)) +* Most other music/media players ## Install `go get github.com/hrfee/waybar-mpris` -or just grab the binary from here. +or just grab the `waybar-mpris` binary from here and place it in your PATH. ## Usage -When running, the program will pipe out json in waybar's format. Make a custom component in your configuration and set `return-type` to `json`, and `exec` to the path to the program. +When running, the program will pipe out json in waybar's format. Add something like this to your waybar `config.json`: +``` json +"custom/waybar-mpris": { + "return-type": "json", + "exec": "waybar-mpris", + "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: + + +``` +Usage of waybar-mpris: + --autofocus Auto switch to currently playing music players. --order string Element order. (default "SYMBOL:ARTIST:ALBUM:TITLE") - --pause string Pause symbol/text to use. (default "") + --pause string Pause symbol/text to use. (default "\uf8e3") --play string Play symbol/text to use. (default "▶") + --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, 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. +* `--separator` specifies a string to separate the artist, album and title text. +* `--autofocus` makes waybar-mpris automatically focus on currently playing music players. +* `--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. + * *Note: you can also bind these commands to keys in your sway/other wm config.* |