xmobar-0.43: A Minimalistic Text Based Status Bar
Copyright(c) 2010 2011 2013 2016 2017 2018 Jose Antonio Ortega Ruiz
(c) 2007-2010 Andrea Rossato
LicenseBSD-style (see LICENSE)
MaintainerJose A. Ortega Ruiz <jao@gnu.org>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Xmobar.Plugins.Monitors.Common

Description

Utilities used by xmobar's monitors

Synopsis

Documentation

showWithColors :: (Num a, Ord a) => (a -> String) -> a -> Monitor String Source #

runP :: Parser [a] -> String -> IO [a] Source #

parseTemplate :: [String] -> Monitor String Source #

Takes a list of strings that represent the values of the exported keys. The strings are joined with the exported keys to form a map to be combined with combine to the parsed template. Returns the final output of the monitor, trimmed to MaxTotalWidth if that configuration value is positive.

parseTemplate' :: String -> Map String String -> Monitor String Source #

Parses the template given to it with a map of export values and combines them

parseOptsWith Source #

Arguments

:: [OptDescr (opts -> opts)]

Options that are specifiable

-> opts

Default options to use as a fallback

-> [String]

Actual arguments given

-> IO opts 

Try to parse arguments from the config file and apply them to Options.

templateParser :: Parser [(String, String, String)] Source #

Combines the template parsers

checkedDataRetrieval :: (Ord a, Num a) => String -> [[String]] -> Maybe (String, String -> Int) -> (Double -> a) -> (a -> String) -> Monitor String Source #