From 2920615ab5d902b51d9ddc82cbd39ab5e6279814 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 23 Dec 2017 03:19:34 +0100 Subject: Honouring NAString in MPris (-x switch) monitor Should fix issue #325 --- news.md | 7 ++++++- src/Plugins/Monitors/Mpris.hs | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/news.md b/news.md index 6de6dcf..18df6c0 100644 --- a/news.md +++ b/news.md @@ -8,8 +8,13 @@ _New features_ be setup in either the configuration file (`wmName` and `wmClass`) or using the new flags `-n` adn `-w` (see [issue #323]). -[issue #303]: https://github.com/jaor/xmobar/issues/323 +_Bug fixes_ + + - Honouring -x in MPris monitor ([issue #325]) + +[issue #323]: https://github.com/jaor/xmobar/issues/323 +[issue #325]: https://github.com/jaor/xmobar/issues/325 ## Version 0.24.5 (May, 2017) diff --git a/src/Plugins/Monitors/Mpris.hs b/src/Plugins/Monitors/Mpris.hs index 0228c8e..ed76dc9 100644 --- a/src/Plugins/Monitors/Mpris.hs +++ b/src/Plugins/Monitors/Mpris.hs @@ -85,7 +85,9 @@ dbusClient = unsafePerformIO DC.connectSession runMPRIS :: (MprisVersion a) => a -> String -> [String] -> Monitor String runMPRIS version playerName _ = do metadata <- io $ getMetadata version dbusClient playerName - mapM showWithPadding (makeList version metadata) >>= parseTemplate + if [] == metadata then + getConfigValue naString + else mapM showWithPadding (makeList version metadata) >>= parseTemplate runMPRIS1 :: String -> [String] -> Monitor String runMPRIS1 = runMPRIS MprisVersion1 -- cgit v1.2.3