summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--news.md7
-rw-r--r--readme.md5
-rw-r--r--src/Plugins/Monitors.hs9
3 files changed, 18 insertions, 3 deletions
diff --git a/news.md b/news.md
index 672903a..a4b0fc3 100644
--- a/news.md
+++ b/news.md
@@ -1,5 +1,12 @@
% xmobar - Release notes
+## Vesion 0.19
+
+_New features_
+
+ - New monitor `BatteryN`, a variant of `BatteryP` that lets you
+ specify the name of the monitor in the template.
+
## Version 0.18 (June 5, 2013)
_New features_
diff --git a/readme.md b/readme.md
index e8e0e96..a341986 100644
--- a/readme.md
+++ b/readme.md
@@ -778,6 +778,11 @@ something like:
- The "idle" AC state is selected whenever the AC power entering the
battery is zero.
+### `BatteryN Dirs Args RefreshRate Alias`
+
+Works like `BatteryP`, but lets you specify an alias for the monitor
+other than "battery". Useful in case you one separate monitors for
+more than one battery.
### `TopProc Args RefreshRate`
diff --git a/src/Plugins/Monitors.hs b/src/Plugins/Monitors.hs
index 8d5ac35..9421170 100644
--- a/src/Plugins/Monitors.hs
+++ b/src/Plugins/Monitors.hs
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Xmobar.Plugins.Monitors
--- Copyright : (c) 2010, 2011, 2012 Jose Antonio Ortega Ruiz
+-- Copyright : (c) 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz
-- (c) 2007-10 Andrea Rossato
-- License : BSD-style (see LICENSE)
--
@@ -52,7 +52,9 @@ import Plugins.Monitors.Mpris
data Monitors = Weather Station Args Rate
| Network Interface Args Rate
| DynNetwork Args Rate
- | BatteryP [String] Args Rate
+ | BatteryP Args Args Rate
+ | BatteryN Args Args Rate Alias
+ | Battery Args Rate
| DiskU DiskSpec Args Rate
| DiskIO DiskSpec Args Rate
| Thermal Zone Args Rate
@@ -61,7 +63,6 @@ data Monitors = Weather Station Args Rate
| Swap Args Rate
| Cpu Args Rate
| MultiCpu Args Rate
- | Battery Args Rate
| Brightness Args Rate
| CpuFreq Args Rate
| CoreTemp Args Rate
@@ -106,6 +107,7 @@ instance Exec Monitors where
alias (MultiCpu _ _) = "multicpu"
alias (Battery _ _) = "battery"
alias (BatteryP _ _ _)= "battery"
+ alias (BatteryN _ _ _ a)= a
alias (Brightness _ _) = "bright"
alias (CpuFreq _ _) = "cpufreq"
alias (TopProc _ _) = "top"
@@ -142,6 +144,7 @@ instance Exec Monitors where
start (Swap a r) = runM a swapConfig runSwap r
start (Battery a r) = runM a battConfig runBatt r
start (BatteryP s a r) = runM a battConfig (runBatt' s) r
+ start (BatteryN s a r _) = runM a battConfig (runBatt' s) r
start (Brightness a r) = runM a brightConfig runBright r
start (CpuFreq a r) = runM a cpuFreqConfig runCpuFreq r
start (CoreTemp a r) = runM a coreTempConfig runCoreTemp r