[modules/playerctl]: BREAKING: use playerctl -f and add playerctl.args

1. Use `playerctl -f` to format, which is more powerful. This also fixes
   #767, which is caused by missing a few fields of the metadata.
2. Add `playerctl.args`, so that users can choose a specific player,
   etc.
3. Display nothing when there's no running player.

This is a breaking change. Users need to change `{title}` to
`{{title}}`.
This commit is contained in:
Yufan You 2021-06-11 17:34:46 +08:00
parent 4b6b4b9052
commit 51f68addcd
No known key found for this signature in database
GPG key ID: 863A0F9FA8127FA4
2 changed files with 37 additions and 36 deletions

View file

@ -1060,12 +1060,14 @@ Requires the following executable:
* playerctl
Parameters:
* playerctl.format: Format string (defaults to '{artist} - {title}')
Available values are: {album}, {title}, {artist}, {trackNumber}
* playerctl.format: Format string (defaults to '{{artist}} - {{title}} {{duration(position)}}/{{duration(mpris:length)}}')
The format string is passed to 'playerctl -f' as an argument. See the 'Format Strings' section of 'man playerctl' for more information.
* playerctl.layout: Comma-separated list to change order of widgets (defaults to song, previous, pause, next)
Widget names are: playerctl.song, playerctl.prev, playerctl.pause, playerctl.next
* playerctl.args: The arguments added to playerctl.
You can check 'playerctl --help' or `its readme <https://github.com/altdesktop/playerctl#using-the-cli>`_. For example, it could be '-p vlc,%any'.
Parameters are inherited from `spotify` module, many thanks to its developers!
Parameters are inspired by the `spotify` module, many thanks to its developers!
contributed by `smitajit <https://github.com/smitajit>`_ - many thanks!