summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Mpris.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2017-12-23 03:19:34 +0100
committerjao <jao@gnu.org>2017-12-23 03:21:39 +0100
commit2920615ab5d902b51d9ddc82cbd39ab5e6279814 (patch)
treef19e32deac75e39d4a81b3164192a3ce3d62856c /src/Plugins/Monitors/Mpris.hs
parentd540a97c0f3c34bf063daf72ece661a83eacb726 (diff)
downloadxmobar-2920615ab5d902b51d9ddc82cbd39ab5e6279814.tar.gz
xmobar-2920615ab5d902b51d9ddc82cbd39ab5e6279814.tar.bz2
Honouring NAString in MPris (-x switch) monitor
Should fix issue #325
Diffstat (limited to 'src/Plugins/Monitors/Mpris.hs')
-rw-r--r--src/Plugins/Monitors/Mpris.hs4
1 files changed, 3 insertions, 1 deletions
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