yambar/doc/yambar-modules-mpris.5.scd
haruInDisguise c27de56bea
Added 'MPRIS' module
This commit adds the ability to display status information for MPRIS
compatible music players.

Closes #53
2025-03-05 08:37:02 +01:00

95 lines
2.1 KiB
Markdown

yambar-modules-mpris(5)
# NAME
mpris - This module provides MPRIS status such as currently playing artist/album/song
# TAGS
[[ *Name*
:[ *Type*
:< *Description*
| state
: string
: One of *offline*, *stopped*, *paused* or *playing*
| shuffle
: bool
: True if the *shuffle* flag is set
| repeat
: string
: One of *none*, *track* or *paylist*
| volume
: range
: Volume in percentage
| album
: string
: Currently playing album
| artist
: string
: Artist of currently playing song
| title
: string
: Title of currently playing song
| file
: string
: Filename or URL of currently playing song
| pos
: string
: *%M:%S*-formatted string describing the song's current position
(also see _elapsed_)
| end
: string
: *%M:%S*-formatted string describing the song's total length (also
see _duration_)
| elapsed
: realtime
: Position in currently playing song, in milliseconds. Can be used
with a _progress-bar_ particle.
# CONFIGURATION
[[ *Name*
:[ *Type*
:[ *Req*
:< *Description*
| identities
: list of string
: yes
: A list of MPRIS client identities
# EXAMPLES
```
bar:
center:
- mpris:
identities:
- "spotify"
- "firefox"
content:
map:
conditions:
state != offline && state != stopped:
- string: {text: "{artist}", max: 30 }
- string: {text: "-" }
- string: {text: "{title}", max: 30 }
```
# NOTE
The 'identity' refers a part of your clients DBus bus name.
You can obtain a list of available bus names using:
```
Systemd: > busctl --user --list
Playerctl: > playerctl --list-all
Libdbus: > dbus-send --session --print-reply --type=method_call --dest='org.freedesktop.DBus' /org org.freedesktop.DBus.ListNames ... | grep 'org.mpris.MediaPlayer2'
```
The identity refers to the part after 'org.mpris.MediaPlayer2'.
For example, firefox may use the bus name
'org.mpris.MediaPlayer2.firefox.instance_1_7' and its identity would be
'firefox'
# SEE ALSO
*yambar-modules*(5), *yambar-particles*(5), *yambar-tags*(5), *yambar-decorations*(5)