summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/CatInt.hs
diff options
context:
space:
mode:
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>2014-05-29 02:16:07 -0400
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>2014-05-29 13:16:38 -0400
commit8f9c5f1ecec8ee13bb0e803a1f26140bb8d8357e (patch)
tree41dab8832b3eb824c319ce49e20f1d30511eaba8 /src/Plugins/Monitors/CatInt.hs
parentf661ea6c7ac3b3884a7a6fc7fec40dedbf2fff05 (diff)
downloadxmobar-8f9c5f1ecec8ee13bb0e803a1f26140bb8d8357e.tar.gz
xmobar-8f9c5f1ecec8ee13bb0e803a1f26140bb8d8357e.tar.bz2
A simple CatInt monitor
Diffstat (limited to 'src/Plugins/Monitors/CatInt.hs')
-rw-r--r--src/Plugins/Monitors/CatInt.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Plugins/Monitors/CatInt.hs b/src/Plugins/Monitors/CatInt.hs
new file mode 100644
index 0000000..3d19270
--- /dev/null
+++ b/src/Plugins/Monitors/CatInt.hs
@@ -0,0 +1,25 @@
+-----------------------------------------------------------------------------
+-- |
+-- Module : Plugins.Monitors.CatInt
+-- Copyright : (c) Nathaniel Wesley Filardo
+-- License : BSD-style (see LICENSE)
+--
+-- Maintainer : Nathaniel Wesley Filardo
+-- Stability : unstable
+-- Portability : unportable
+--
+-----------------------------------------------------------------------------
+
+module Plugins.Monitors.CatInt where
+
+import Plugins.Monitors.Common
+import Plugins.Monitors.CoreCommon
+
+catIntConfig :: IO MConfig
+catIntConfig = mkMConfig "<v>" ["v"]
+
+runCatInt :: FilePath -> [String] -> Monitor String
+runCatInt p _ =
+ let failureMessage = "Cannot read: " ++ (show p)
+ fmt x = show (truncate x :: Int)
+ in checkedDataRetrieval failureMessage [[p]] Nothing id fmt