xmobar

Portabilityunportable
Stabilityunstable
MaintainerJose A. Ortega Ruiz <jao@gnu.org>
Safe HaskellNone

Plugins.Monitors.Common

Contents

Description

Utilities used by xmobar's monitors

Synopsis

Monitors

 

type Monitor a = ReaderT MConfig IO a

data MConfig

Constructors

MC 

Fields

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

Constructors

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 ()

runMB :: [String] -> IO MConfig -> ([String] -> Monitor String) -> IO () -> (String -> IO ()) -> IO ()

io :: IO a -> Monitor a

Parsers

 

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

getAllBut :: String -> 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

 

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

showLogBar :: 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