summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2008-03-16 17:01:15 +0100
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2008-03-16 17:01:15 +0100
commit7a7e4aa53317e8bba1c6781e65ec8274c1e58524 (patch)
tree0343eaadb69617e56099546dc397162b6d7d2460 /Plugins/Monitors.hs
parentd777ba363bd49f6c2839979b2a49921632039e50 (diff)
downloadxmobar-7a7e4aa53317e8bba1c6781e65ec8274c1e58524.tar.gz
xmobar-7a7e4aa53317e8bba1c6781e65ec8274c1e58524.tar.bz2
Add BatteryP a monitor for batteries
With this monitor is possible to set specific location where to retrieve battery information. For example: Run BatteryP ["BAT0","BAT1","BAT2"] [] 10 this will read the following files: /proc/acpi/battery/BAT0/info and /proc/acpi/battery/BAT0/state /proc/acpi/battery/BAT1/info and /proc/acpi/battery/BAT1/state /proc/acpi/battery/BAT1/info and /proc/acpi/battery/BAT2/state darcs-hash:20080316160115-d6583-efd35abf7a6a1a40fcb5f97ec430783f40b3221d.gz
Diffstat (limited to 'Plugins/Monitors.hs')
-rw-r--r--Plugins/Monitors.hs57
1 files changed, 30 insertions, 27 deletions
diff --git a/Plugins/Monitors.hs b/Plugins/Monitors.hs
index 5be6057..690e198 100644
--- a/Plugins/Monitors.hs
+++ b/Plugins/Monitors.hs
@@ -3,7 +3,7 @@
-- Module : Xmobar.Plugins.Monitors
-- Copyright : (c) Andrea Rossato
-- License : BSD-style (see LICENSE)
---
+--
-- Maintainer : Andrea Rossato <andrea.rossato@unibz.it>
-- Stability : unstable
-- Portability : unportable
@@ -27,15 +27,16 @@ import Plugins.Monitors.Thermal
import Plugins.Monitors.CpuFreq
import Plugins.Monitors.CoreTemp
-data Monitors = Weather Station Args Rate
+data Monitors = Weather Station Args Rate
| Network Interface Args Rate
- | Memory Args Rate
- | Swap Args Rate
- | Cpu Args Rate
- | Battery Args Rate
- | Thermal Zone Args Rate
- | CpuFreq Args Rate
- | CoreTemp Args Rate
+ | Memory Args Rate
+ | Swap Args Rate
+ | Cpu Args Rate
+ | Battery Args Rate
+ | BatteryP [String] Args Rate
+ | Thermal Zone Args Rate
+ | CpuFreq Args Rate
+ | CoreTemp Args Rate
deriving (Show,Read,Eq)
type Args = [String]
@@ -47,21 +48,23 @@ type Interface = String
type Rate = Int
instance Exec Monitors where
- alias (Weather s _ _) = s
- alias (Network i _ _) = i
- alias (Thermal z _ _) = z
- alias (Memory _ _) = "memory"
- alias (Swap _ _) = "swap"
- alias (Cpu _ _) = "cpu"
- alias (Battery _ _) = "battery"
- alias (CpuFreq _ _) = "cpufreq"
- alias (CoreTemp _ _) = "coretemp"
- start (Weather s a r) = runM (a ++ [s]) weatherConfig runWeather r
- start (Network i a r) = runM (a ++ [i]) netConfig runNet r
- start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r
- start (Memory a r) = runM a memConfig runMem r
- start (Swap a r) = runM a swapConfig runSwap r
- start (Cpu a r) = runM a cpuConfig runCpu r
- start (Battery a r) = runM a battConfig runBatt r
- start (CpuFreq a r) = runM a cpuFreqConfig runCpuFreq r
- start (CoreTemp a r) = runM a coreTempConfig runCoreTemp r
+ alias (Weather s _ _) = s
+ alias (Network i _ _) = i
+ alias (Thermal z _ _) = z
+ alias (Memory _ _) = "memory"
+ alias (Swap _ _) = "swap"
+ alias (Cpu _ _) = "cpu"
+ alias (Battery _ _) = "battery"
+ alias (BatteryP _ _ _) = "battery"
+ alias (CpuFreq _ _) = "cpufreq"
+ alias (CoreTemp _ _) = "coretemp"
+ start (Weather s a r) = runM (a ++ [s]) weatherConfig runWeather r
+ start (Network i a r) = runM (a ++ [i]) netConfig runNet r
+ start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r
+ start (Memory a r) = runM a memConfig runMem r
+ start (Swap a r) = runM a swapConfig runSwap r
+ start (Cpu a r) = runM a cpuConfig runCpu r
+ start (Battery a r) = runM a battConfig runBatt r
+ start (BatteryP s a r) = runM a battConfig (runBatt' s) r
+ start (CpuFreq a r) = runM a cpuFreqConfig runCpuFreq r
+ start (CoreTemp a r) = runM a coreTempConfig runCoreTemp r