summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--changelog.md2
-rw-r--r--readme.md5
-rw-r--r--src/Xmobar/Plugins/Monitors.hs7
3 files changed, 12 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md
index 28ae950..cfa9ada 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,8 @@
_New features_
- New command line option `--add-font` (Ivan Brennan)
+ - New monitor `MPDX` that extends `MPD` with the ability of having a
+ custom alias. Useful for connecting with multiple servers.
_Bug fixes_
diff --git a/readme.md b/readme.md
index 7f3848c..5284d88 100644
--- a/readme.md
+++ b/readme.md
@@ -45,6 +45,7 @@
- [`Volume Mixer Element Args RefreshRate`](#volume-mixer-element-args-refreshrate)
- [`Alsa Mixer Element Args`](#alsa-mixer-element-args)
- [`MPD Args RefreshRate`](#mpd-args-refreshrate)
+ - [`MPDX Alias Args RefreshRate`](#mpdx-alias-args-refreshrate)
- [`Mpris1 PlayerName Args RefreshRate`](#mpris1-playername-args-refreshrate)
- [`Mpris2 PlayerName Args RefreshRate`](#mpris2-playername-args-refreshrate)
- [`Mail Args Alias`](#mail-args-alias)
@@ -1274,6 +1275,10 @@ following differences:
"<composer> <title> (<album>) <track>/<plength> <statei> [<flags>]",
"--", "-P", ">>", "-Z", "|", "-S", "><"] 10
+## `MPDX Alias Args RefreshRate`
+
+Like `MPD` but uses as alias its first argument instead of "mpd".
+
## `Mpris1 PlayerName Args RefreshRate`
- Aliases to `mpris1`
diff --git a/src/Xmobar/Plugins/Monitors.hs b/src/Xmobar/Plugins/Monitors.hs
index 322d401..cca0948 100644
--- a/src/Xmobar/Plugins/Monitors.hs
+++ b/src/Xmobar/Plugins/Monitors.hs
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Xmobar.Plugins.Monitors
--- Copyright : (c) 2010, 2011, 2012, 2013, 2017, 2018, 2019 Jose Antonio Ortega Ruiz
+-- Copyright : (c) 2010, 2011, 2012, 2013, 2017, 2018, 2019, 2020 Jose Antonio Ortega Ruiz
-- (c) 2007-10 Andrea Rossato
-- License : BSD-style (see LICENSE)
--
@@ -89,7 +89,8 @@ data Monitors = Network Interface Args Rate
| Wireless Interface Args Rate
#endif
#ifdef LIBMPD
- | MPD Args Rate
+ | MPD Args Rate
+ | MPDX String Args Rate
| AutoMPD Args
#endif
#ifdef ALSA
@@ -148,6 +149,7 @@ instance Exec Monitors where
#ifdef LIBMPD
alias (MPD _ _) = "mpd"
alias (AutoMPD _) = "autompd"
+ alias (MPDX a _ _) = a
#endif
#ifdef ALSA
alias (Volume m c _ _) = m ++ ":" ++ c
@@ -191,6 +193,7 @@ instance Exec Monitors where
#endif
#ifdef LIBMPD
start (MPD a r) = runMD a mpdConfig runMPD r mpdReady
+ start (MPDX _ a r) = start (MPD a r)
start (AutoMPD a) = runMBD a mpdConfig runMPD mpdWait mpdReady
#endif
#ifdef ALSA