module Xmobar.Config.Types
( Config (..)
, XPosition (..), Align (..), Border (..), TextOutputFormat (..)
, Segment
, FontIndex
, Box(..)
, BoxBorder(..)
, BoxOffset(..)
, BoxMargins(..)
, TextRenderInfo(..)
, Widget(..)
, SignalChan (..)
, Action (..)
, Button
) where
import qualified Control.Concurrent.STM as STM
import qualified Xmobar.Run.Runnable as R
import qualified Xmobar.System.Signal as S
import Data.Int (Int32)
import Foreign.C.Types (CInt)
import Xmobar.Run.Actions (Action (..), Button)
data Config =
Config { Config -> String
font :: String
, Config -> [String]
additionalFonts :: [String]
, Config -> String
wmClass :: String
, Config -> String
wmName :: String
, Config -> String
bgColor :: String
, Config -> String
fgColor :: String
, Config -> XPosition
position :: XPosition
, Config -> Bool
textOutput :: Bool
, Config -> TextOutputFormat
textOutputFormat :: TextOutputFormat
, Config -> Int
textOffset :: Int
, Config -> [Int]
textOffsets :: [Int]
, Config -> Int
iconOffset :: Int
, Config -> Border
border :: Border
, Config -> String
borderColor :: String
, Config -> Int
borderWidth :: Int
, Config -> Int
alpha :: Int
, Config -> Bool
hideOnStart :: Bool
, Config -> Bool
allDesktops :: Bool
, Config -> Bool
overrideRedirect :: Bool
, Config -> Bool
pickBroadest :: Bool
, Config -> Bool
lowerOnStart :: Bool
, Config -> Bool
persistent :: Bool
, Config -> String
iconRoot :: FilePath
, Config -> [Runnable]
commands :: [R.Runnable]
, Config -> String
sepChar :: String
, Config -> String
alignSep :: String
, Config -> String
template :: String
, Config -> Bool
verbose :: Bool
, Config -> SignalChan
signal :: SignalChan
, Config -> Double
dpi :: Double
} deriving (ReadPrec [Config]
ReadPrec Config
Int -> ReadS Config
ReadS [Config]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Config]
$creadListPrec :: ReadPrec [Config]
readPrec :: ReadPrec Config
$creadPrec :: ReadPrec Config
readList :: ReadS [Config]
$creadList :: ReadS [Config]
readsPrec :: Int -> ReadS Config
$creadsPrec :: Int -> ReadS Config
Read, Int -> Config -> ShowS
[Config] -> ShowS
Config -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Config] -> ShowS
$cshowList :: [Config] -> ShowS
show :: Config -> String
$cshow :: Config -> String
showsPrec :: Int -> Config -> ShowS
$cshowsPrec :: Int -> Config -> ShowS
Show)
data XPosition = Top
| TopH
Int
| TopHM
Int
Int
Int
Int
Int
| TopW
Align
Int
| TopSize
Align
Int
Int
| TopP
Int
Int
| Bottom
| BottomH
Int
| BottomHM
Int
Int
Int
Int
Int
| BottomP
Int
Int
| BottomW
Align
Int
| BottomSize
Align
Int
Int
| Static { XPosition -> Int
xpos :: Int
, XPosition -> Int
ypos :: Int
, XPosition -> Int
width :: Int
, XPosition -> Int
height :: Int
}
| OnScreen
Int
XPosition
deriving ( ReadPrec [XPosition]
ReadPrec XPosition
Int -> ReadS XPosition
ReadS [XPosition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [XPosition]
$creadListPrec :: ReadPrec [XPosition]
readPrec :: ReadPrec XPosition
$creadPrec :: ReadPrec XPosition
readList :: ReadS [XPosition]
$creadList :: ReadS [XPosition]
readsPrec :: Int -> ReadS XPosition
$creadsPrec :: Int -> ReadS XPosition
Read, Int -> XPosition -> ShowS
[XPosition] -> ShowS
XPosition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [XPosition] -> ShowS
$cshowList :: [XPosition] -> ShowS
show :: XPosition -> String
$cshow :: XPosition -> String
showsPrec :: Int -> XPosition -> ShowS
$cshowsPrec :: Int -> XPosition -> ShowS
Show, XPosition -> XPosition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XPosition -> XPosition -> Bool
$c/= :: XPosition -> XPosition -> Bool
== :: XPosition -> XPosition -> Bool
$c== :: XPosition -> XPosition -> Bool
Eq )
data Align = L | R | C deriving ( ReadPrec [Align]
ReadPrec Align
Int -> ReadS Align
ReadS [Align]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Align]
$creadListPrec :: ReadPrec [Align]
readPrec :: ReadPrec Align
$creadPrec :: ReadPrec Align
readList :: ReadS [Align]
$creadList :: ReadS [Align]
readsPrec :: Int -> ReadS Align
$creadsPrec :: Int -> ReadS Align
Read, Int -> Align -> ShowS
[Align] -> ShowS
Align -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Align] -> ShowS
$cshowList :: [Align] -> ShowS
show :: Align -> String
$cshow :: Align -> String
showsPrec :: Int -> Align -> ShowS
$cshowsPrec :: Int -> Align -> ShowS
Show, Align -> Align -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Align -> Align -> Bool
$c/= :: Align -> Align -> Bool
== :: Align -> Align -> Bool
$c== :: Align -> Align -> Bool
Eq )
data Border = NoBorder
| TopB
| BottomB
| FullB
| TopBM Int
| BottomBM Int
| FullBM Int
deriving ( ReadPrec [Border]
ReadPrec Border
Int -> ReadS Border
ReadS [Border]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Border]
$creadListPrec :: ReadPrec [Border]
readPrec :: ReadPrec Border
$creadPrec :: ReadPrec Border
readList :: ReadS [Border]
$creadList :: ReadS [Border]
readsPrec :: Int -> ReadS Border
$creadsPrec :: Int -> ReadS Border
Read, Int -> Border -> ShowS
[Border] -> ShowS
Border -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Border] -> ShowS
$cshowList :: [Border] -> ShowS
show :: Border -> String
$cshow :: Border -> String
showsPrec :: Int -> Border -> ShowS
$cshowsPrec :: Int -> Border -> ShowS
Show, Border -> Border -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Border -> Border -> Bool
$c/= :: Border -> Border -> Bool
== :: Border -> Border -> Bool
$c== :: Border -> Border -> Bool
Eq )
data TextOutputFormat = Plain | Ansi | Pango | Swaybar deriving (ReadPrec [TextOutputFormat]
ReadPrec TextOutputFormat
Int -> ReadS TextOutputFormat
ReadS [TextOutputFormat]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TextOutputFormat]
$creadListPrec :: ReadPrec [TextOutputFormat]
readPrec :: ReadPrec TextOutputFormat
$creadPrec :: ReadPrec TextOutputFormat
readList :: ReadS [TextOutputFormat]
$creadList :: ReadS [TextOutputFormat]
readsPrec :: Int -> ReadS TextOutputFormat
$creadsPrec :: Int -> ReadS TextOutputFormat
Read, Int -> TextOutputFormat -> ShowS
[TextOutputFormat] -> ShowS
TextOutputFormat -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextOutputFormat] -> ShowS
$cshowList :: [TextOutputFormat] -> ShowS
show :: TextOutputFormat -> String
$cshow :: TextOutputFormat -> String
showsPrec :: Int -> TextOutputFormat -> ShowS
$cshowsPrec :: Int -> TextOutputFormat -> ShowS
Show, TextOutputFormat -> TextOutputFormat -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TextOutputFormat -> TextOutputFormat -> Bool
$c/= :: TextOutputFormat -> TextOutputFormat -> Bool
== :: TextOutputFormat -> TextOutputFormat -> Bool
$c== :: TextOutputFormat -> TextOutputFormat -> Bool
Eq)
type FontIndex = Int
newtype SignalChan = SignalChan {SignalChan -> Maybe (TMVar SignalType)
unSignalChan :: Maybe (STM.TMVar S.SignalType)}
instance Read SignalChan where
readsPrec :: Int -> ReadS SignalChan
readsPrec Int
_ String
_ = forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"SignalChan is not readable from a String"
instance Show SignalChan where
show :: SignalChan -> String
show (SignalChan (Just TMVar SignalType
_)) = String
"SignalChan (Just <tmvar>)"
show (SignalChan Maybe (TMVar SignalType)
Nothing) = String
"SignalChan Nothing"
data Widget = Icon String | Text String | Hspace Int32 deriving Int -> Widget -> ShowS
[Widget] -> ShowS
Widget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Widget] -> ShowS
$cshowList :: [Widget] -> ShowS
show :: Widget -> String
$cshow :: Widget -> String
showsPrec :: Int -> Widget -> ShowS
$cshowsPrec :: Int -> Widget -> ShowS
Show
data BoxOffset = BoxOffset Align Int32 deriving (BoxOffset -> BoxOffset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoxOffset -> BoxOffset -> Bool
$c/= :: BoxOffset -> BoxOffset -> Bool
== :: BoxOffset -> BoxOffset -> Bool
$c== :: BoxOffset -> BoxOffset -> Bool
Eq, Int -> BoxOffset -> ShowS
[BoxOffset] -> ShowS
BoxOffset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BoxOffset] -> ShowS
$cshowList :: [BoxOffset] -> ShowS
show :: BoxOffset -> String
$cshow :: BoxOffset -> String
showsPrec :: Int -> BoxOffset -> ShowS
$cshowsPrec :: Int -> BoxOffset -> ShowS
Show)
data BoxMargins = BoxMargins Int32 Int32 Int32 Int32 deriving (BoxMargins -> BoxMargins -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoxMargins -> BoxMargins -> Bool
$c/= :: BoxMargins -> BoxMargins -> Bool
== :: BoxMargins -> BoxMargins -> Bool
$c== :: BoxMargins -> BoxMargins -> Bool
Eq, Int -> BoxMargins -> ShowS
[BoxMargins] -> ShowS
BoxMargins -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BoxMargins] -> ShowS
$cshowList :: [BoxMargins] -> ShowS
show :: BoxMargins -> String
$cshow :: BoxMargins -> String
showsPrec :: Int -> BoxMargins -> ShowS
$cshowsPrec :: Int -> BoxMargins -> ShowS
Show)
data BoxBorder = BBTop
| BBBottom
| BBVBoth
| BBLeft
| BBRight
| BBHBoth
| BBFull
deriving (ReadPrec [BoxBorder]
ReadPrec BoxBorder
Int -> ReadS BoxBorder
ReadS [BoxBorder]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BoxBorder]
$creadListPrec :: ReadPrec [BoxBorder]
readPrec :: ReadPrec BoxBorder
$creadPrec :: ReadPrec BoxBorder
readList :: ReadS [BoxBorder]
$creadList :: ReadS [BoxBorder]
readsPrec :: Int -> ReadS BoxBorder
$creadsPrec :: Int -> ReadS BoxBorder
Read, BoxBorder -> BoxBorder -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoxBorder -> BoxBorder -> Bool
$c/= :: BoxBorder -> BoxBorder -> Bool
== :: BoxBorder -> BoxBorder -> Bool
$c== :: BoxBorder -> BoxBorder -> Bool
Eq, Int -> BoxBorder -> ShowS
[BoxBorder] -> ShowS
BoxBorder -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BoxBorder] -> ShowS
$cshowList :: [BoxBorder] -> ShowS
show :: BoxBorder -> String
$cshow :: BoxBorder -> String
showsPrec :: Int -> BoxBorder -> ShowS
$cshowsPrec :: Int -> BoxBorder -> ShowS
Show)
data Box = Box { Box -> BoxBorder
bBorder :: BoxBorder
, Box -> BoxOffset
bOffset :: BoxOffset
, Box -> CInt
bWidth :: CInt
, Box -> String
bColor :: String
, Box -> BoxMargins
bMargins :: BoxMargins
} deriving (Box -> Box -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Box -> Box -> Bool
$c/= :: Box -> Box -> Bool
== :: Box -> Box -> Bool
$c== :: Box -> Box -> Bool
Eq, Int -> Box -> ShowS
[Box] -> ShowS
Box -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Box] -> ShowS
$cshowList :: [Box] -> ShowS
show :: Box -> String
$cshow :: Box -> String
showsPrec :: Int -> Box -> ShowS
$cshowsPrec :: Int -> Box -> ShowS
Show)
data TextRenderInfo = TextRenderInfo { :: String
, TextRenderInfo -> Int32
tBgTopOffset :: Int32
, TextRenderInfo -> Int32
tBgBottomOffset :: Int32
, TextRenderInfo -> [Box]
tBoxes :: [Box]
} deriving Int -> TextRenderInfo -> ShowS
[TextRenderInfo] -> ShowS
TextRenderInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TextRenderInfo] -> ShowS
$cshowList :: [TextRenderInfo] -> ShowS
show :: TextRenderInfo -> String
$cshow :: TextRenderInfo -> String
showsPrec :: Int -> TextRenderInfo -> ShowS
$cshowsPrec :: Int -> TextRenderInfo -> ShowS
Show
type Segment = (Widget, TextRenderInfo, FontIndex, Maybe [Action])