xmobar-0.49: 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

type IconPattern = Int -> String Source #

padString :: Int -> Int -> String -> Bool -> String -> String -> String Source #

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

showWithPadding :: String -> Monitor String Source #

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

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

showPercentsWithColors :: [Float] -> Monitor [String] Source #

showPercentBar :: Float -> Float -> Monitor String Source #

showVerticalBar :: Float -> Float -> Monitor String Source #

showIconPattern :: Maybe IconPattern -> Float -> Monitor String Source #

showLogBar :: Float -> Float -> Monitor String Source #

showLogVBar :: Float -> Float -> Monitor String Source #

showLogIconPattern :: Maybe IconPattern -> Float -> Float -> Monitor String Source #

showWithUnits :: Int -> Int -> Float -> String Source #

takeDigits :: Int -> Float -> Float Source #

showDigits :: RealFloat a => Int -> a -> String Source #

floatToPercent :: Float -> Monitor String Source #

parseFloat :: String -> Float Source #

parseInt :: String -> Int Source #

stringParser :: Pos -> ByteString -> String Source #

pShowPercentsWithColors :: MonadIO m => MonitorConfig -> [Float] -> m [String] Source #

pShowPercentBar :: MonadIO m => MonitorConfig -> Float -> Float -> m String Source #

pShowVerticalBar :: MonadIO m => MonitorConfig -> Float -> Float -> m String Source #

pShowIconPattern :: Maybe IconPattern -> Float -> IO String Source #

pShowPercentWithColors :: MonadIO m => MonitorConfig -> Float -> m String 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.

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

skipRestOfLine :: Parser Char Source #

getNumbers :: Parser Float Source #

getNumbersAsString :: Parser String Source #

getAllBut :: String -> Parser String Source #

getAfterString :: String -> Parser String Source #

skipTillString :: String -> Parser String Source #

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

runExportParser :: [String] -> IO [(String, [(String, String, String)])] Source #

runTemplateParser :: MonitorConfig -> IO [(String, String, String)] Source #

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

checkedDataRead :: [[String]] -> Monitor [Double] Source #