From 30902974c1a21990930f302c50e136954aed4c76 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Fri, 12 Oct 2012 05:04:18 +0200 Subject: Additional MPRIS2 arguments --- news.md | 1 + readme.md | 17 +++++++++++++---- src/Plugins/Monitors/Mpris.hs | 7 +++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/news.md b/news.md index cc87a72..7ff265b 100644 --- a/news.md +++ b/news.md @@ -22,6 +22,7 @@ _New features_ Trofimovich). - Dependencies on the deprecated dbus-core removed in favour of dbus 0.10 (thanks to Jochen Keil). + - MPris2 now includes genre and composer among its fields. _Bug fixes_ diff --git a/readme.md b/readme.md index 2764478..74438b0 100644 --- a/readme.md +++ b/readme.md @@ -906,13 +906,22 @@ something like: - Default template: ` - ` - Example: - Run Mpris1 "clementine" ["-t", - "<artist> - [<tracknumber>] <title>"] 10 + Run Mpris1 "clementine" ["-t", "<artist> - [<tracknumber>] <title>"] 10 ### `Mpris2 PlayerName Args RefreshRate` -- Just like Mpris1. - Supposed to be used with mediaplayers which support MPRIS v2. +- Aliases to `mpris1` +- Requires [dbus] and [text] packages. + To activate, pass `--flags="with_mpris"` during compilation. +- PlayerName: player supporting MPRIS v2 protocol, in lowercase. +- Args: default monitor arguments. +- Variables that can be used with the `-t`/`--template` argument: + `album`, `artist`, `arturl`, `length`, `title`, + `tracknumber`, `composer`, `genre` +- Default template: `<artist> - <title>` +- Example: + + Run Mpris2 "clementine" ["-t", "<artist> - [<composer>] <title>"] 10 ### `Mail Args Alias` diff --git a/src/Plugins/Monitors/Mpris.hs b/src/Plugins/Monitors/Mpris.hs index b899a16..98b4c0f 100644 --- a/src/Plugins/Monitors/Mpris.hs +++ b/src/Plugins/Monitors/Mpris.hs @@ -66,12 +66,15 @@ instance MprisVersion MprisVersion2 where ["org.mpris.MediaPlayer2.Player", "Metadata"] fieldsList MprisVersion2 = [ "xesam:album", "xesam:artist", "mpris:artUrl" - , "mpris:length", "xesam:title", "xesam:trackNumber" + , "mpris:length", "xesam:title", + "xesam:trackNumber", "xesam:composer", + "xesam:genre" ] mprisConfig :: IO MConfig mprisConfig = mkMConfig "<artist> - <title>" - [ "album", "artist", "arturl", "length" , "title", "tracknumber" + [ "album", "artist", "arturl", "length" + , "title", "tracknumber" , "composer", "genre" ] dbusClient :: DC.Client -- cgit v1.2.3