From e9ce98d934861a96f76f673b88fda55f4ceeb900 Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 26 Jul 2016 03:46:29 +0200 Subject: MPris: honour field padding and width options --- news.md | 2 ++ src/Plugins/Monitors/Mpris.hs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/news.md b/news.md index 297724e..1e99da3 100644 --- a/news.md +++ b/news.md @@ -26,6 +26,8 @@ _Bug fixes_ - The `Battery` plugin does now a better job at tracking AC status and times (see [issue #231]). - `PipeReader` was polling too often (thanks to zlbruce). + - The `MPris` monitor now honours field width and padding optons + (-M, -w, etc.). [issue #231]: https://github.com/jaor/xmobar/issues/225 diff --git a/src/Plugins/Monitors/Mpris.hs b/src/Plugins/Monitors/Mpris.hs index 05718cf..200e9f7 100644 --- a/src/Plugins/Monitors/Mpris.hs +++ b/src/Plugins/Monitors/Mpris.hs @@ -84,7 +84,7 @@ dbusClient = unsafePerformIO DC.connectSession runMPRIS :: (MprisVersion a) => a -> String -> [String] -> Monitor String runMPRIS version playerName _ = do metadata <- io $ getMetadata version dbusClient playerName - parseTemplate $ makeList version metadata + mapM showWithPadding (makeList version metadata) >>= parseTemplate runMPRIS1 :: String -> [String] -> Monitor String runMPRIS1 = runMPRIS MprisVersion1 -- cgit v1.2.3