Portability | unportable |
---|---|
Stability | unstable |
Maintainer | Jose A. Ortega Ruiz <jao@gnu.org> |
Safe Haskell | None |
Plugins.Monitors.Common
Contents
Description
Utilities used by xmobar's monitors
- type Monitor a = ReaderT MConfig IO a
- data MConfig = MC {
- normalColor :: IORef (Maybe String)
- low :: IORef Int
- lowColor :: IORef (Maybe String)
- high :: IORef Int
- highColor :: IORef (Maybe String)
- template :: IORef String
- export :: IORef [String]
- ppad :: IORef Int
- decDigits :: IORef Int
- minWidth :: IORef Int
- maxWidth :: IORef Int
- padChars :: IORef String
- padRight :: IORef Bool
- barBack :: IORef String
- barFore :: IORef String
- barWidth :: IORef Int
- useSuffix :: IORef Bool
- naString :: IORef String
- data Opts
- = HighColor String
- | NormalColor String
- | LowColor String
- | Low String
- | High String
- | Template String
- | PercentPad String
- | DecDigits String
- | MinWidth String
- | MaxWidth String
- | Width String
- | PadChars String
- | PadAlign String
- | BarBack String
- | BarFore String
- | BarWidth String
- | UseSuffix String
- | NAString String
- setConfigValue :: a -> Selector a -> Monitor ()
- getConfigValue :: Selector a -> Monitor a
- mkMConfig :: String -> [String] -> IO MConfig
- runM :: [String] -> IO MConfig -> ([String] -> Monitor String) -> Int -> (String -> IO ()) -> IO ()
- runMD :: [String] -> IO MConfig -> ([String] -> Monitor String) -> Int -> ([String] -> Monitor Bool) -> (String -> IO ()) -> IO ()
- runMB :: [String] -> IO MConfig -> ([String] -> Monitor String) -> IO () -> (String -> IO ()) -> IO ()
- runMBD :: [String] -> IO MConfig -> ([String] -> Monitor String) -> IO () -> ([String] -> Monitor Bool) -> (String -> IO ()) -> IO ()
- io :: IO a -> Monitor a
- 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
- type IconPattern = Int -> String
- parseIconPattern :: String -> IconPattern
- padString :: Int -> Int -> String -> Bool -> String -> 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
Monitors
data MConfig
Constructors
MC | |
Fields
|
data Opts
setConfigValue :: a -> Selector a -> Monitor ()
getConfigValue :: Selector a -> Monitor a
runMD :: [String] -> IO MConfig -> ([String] -> Monitor String) -> Int -> ([String] -> Monitor Bool) -> (String -> IO ()) -> IO ()
runMB :: [String] -> IO MConfig -> ([String] -> Monitor String) -> IO () -> (String -> IO ()) -> IO ()
runMBD :: [String] -> IO MConfig -> ([String] -> Monitor String) -> IO () -> ([String] -> Monitor Bool) -> (String -> IO ()) -> IO ()
Parsers
skipRestOfLine :: Parser Char
getNumbers :: Parser Float
getNumbersAsString :: Parser String
getAfterString :: String -> Parser String
skipTillString :: String -> Parser String
parseTemplate :: [String] -> Monitor String
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.
parseTemplate' :: String -> Map String String -> Monitor String
Parses the template given to it with a map of export values and combines them
String Manipulation
type IconPattern = Int -> String
parseIconPattern :: String -> IconPattern
padString :: Int -> Int -> String -> Bool -> String -> 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