1-----------------------------------------------------------------------------
2-- |
3-- Module      :  Plugins.Monitors.CatInt
4-- Copyright   :  (c) Nathaniel Wesley Filardo
5-- License     :  BSD-style (see LICENSE)
6--
7-- Maintainer  :  Nathaniel Wesley Filardo
8-- Stability   :  unstable
9-- Portability :  unportable
10--
11-----------------------------------------------------------------------------
12
13module Xmobar.Plugins.Monitors.CatInt where
14
15import Xmobar.Plugins.Monitors.Common
16
17catIntConfig :: IO MConfig
18catIntConfig = mkMConfig "<v>" ["v"]
19
20runCatInt :: FilePath -> [String] -> Monitor String
21runCatInt p _ =
22  let failureMessage = "Cannot read: " ++ show p
23      fmt x = show (truncate x :: Int)
24  in  checkedDataRetrieval failureMessage [[p]] Nothing id fmt
25