Copyright | (c) 2010 2011 2013 2016 2017 2018 Jose Antonio Ortega Ruiz (c) 2007-2010 Andrea Rossato |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Jose A. Ortega Ruiz <jao@gnu.org> |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Utilities used by xmobar's monitors
Synopsis
- module Xmobar.Plugins.Monitors.Common.Types
- module Xmobar.Plugins.Monitors.Common.Run
- type IconPattern = Int -> String
- parseIconPattern :: String -> IconPattern
- padString :: Int -> Int -> String -> Bool -> String -> String -> String
- colorizeString :: (Num a, Ord a) => a -> String -> Monitor String
- showWithPadding :: String -> Monitor String
- showWithColors :: (Num a, Ord a) => (a -> String) -> a -> Monitor String
- showWithColors' :: (Num a, Ord a) => String -> a -> Monitor String
- showPercentWithColors :: Float -> Monitor String
- showPercentsWithColors :: [Float] -> Monitor [String]
- showPercentBar :: Float -> Float -> Monitor String
- showVerticalBar :: Float -> Float -> Monitor String
- showIconPattern :: Maybe IconPattern -> Float -> Monitor String
- showLogBar :: Float -> Float -> Monitor String
- showLogVBar :: Float -> Float -> Monitor String
- showLogIconPattern :: Maybe IconPattern -> Float -> Float -> Monitor String
- showWithUnits :: Int -> Int -> Float -> String
- takeDigits :: Int -> Float -> Float
- showDigits :: RealFloat a => Int -> a -> String
- floatToPercent :: Float -> Monitor String
- parseFloat :: String -> Float
- parseInt :: String -> Int
- stringParser :: Pos -> ByteString -> String
- pShowPercentsWithColors :: MonadIO m => MonitorConfig -> [Float] -> m [String]
- pShowPercentBar :: MonadIO m => MonitorConfig -> Float -> Float -> m String
- pShowVerticalBar :: MonadIO m => MonitorConfig -> Float -> Float -> m String
- pShowIconPattern :: Maybe IconPattern -> Float -> IO String
- pShowPercentWithColors :: MonadIO m => MonitorConfig -> Float -> m String
- runP :: Parser [a] -> String -> IO [a]
- skipRestOfLine :: Parser Char
- getNumbers :: Parser Float
- getNumbersAsString :: Parser String
- getAllBut :: String -> Parser String
- getAfterString :: String -> Parser String
- skipTillString :: String -> Parser String
- parseTemplate :: [String] -> Monitor String
- parseTemplate' :: String -> Map String String -> Monitor String
- parseOptsWith :: [OptDescr (opts -> opts)] -> opts -> [String] -> IO opts
- templateParser :: Parser [(String, String, String)]
- runExportParser :: [String] -> IO [(String, [(String, String, String)])]
- runTemplateParser :: MonitorConfig -> IO [(String, String, String)]
- pureParseTemplate :: MonitorConfig -> TemplateInput -> IO String
- checkedDataRetrieval :: (Ord a, Num a) => String -> [[String]] -> Maybe (String, String -> Int) -> (Double -> a) -> (a -> String) -> Monitor String
- checkedDataRead :: [[String]] -> Monitor [Double]
Documentation
type IconPattern = Int -> String Source #
parseIconPattern :: String -> IconPattern Source #
showIconPattern :: Maybe IconPattern -> Float -> Monitor String Source #
showLogIconPattern :: Maybe IconPattern -> Float -> Float -> Monitor String Source #
parseFloat :: String -> Float 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 #
getNumbers :: Parser Float 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
:: [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.
runTemplateParser :: MonitorConfig -> IO [(String, String, String)] Source #
pureParseTemplate :: MonitorConfig -> TemplateInput -> IO String Source #