diff options
author | jao <jao@gnu.org> | 2018-11-24 20:36:10 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2018-11-24 20:36:10 +0000 |
commit | 4af5117eb47028b234f4779c9c62cf344320e151 (patch) | |
tree | e981eb8934e52cb63a5bed1f7ab6240edc543eca /src/lib/Xmobar/Types.hs | |
parent | c84a2e586563cce90f4324eb38bfb2e2207eb7fc (diff) | |
download | xmobar-4af5117eb47028b234f4779c9c62cf344320e151.tar.gz xmobar-4af5117eb47028b234f4779c9c62cf344320e151.tar.bz2 |
Refactoring: cleaner separation app/lib and more cleanups
Diffstat (limited to 'src/lib/Xmobar/Types.hs')
-rw-r--r-- | src/lib/Xmobar/Types.hs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/Xmobar/Types.hs b/src/lib/Xmobar/Types.hs new file mode 100644 index 0000000..f7c4fdf --- /dev/null +++ b/src/lib/Xmobar/Types.hs @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- | +-- Module: Xmobar.Types +-- Copyright: (c) 2018 Jose Antonio Ortega Ruiz +-- License: BSD3-style (see LICENSE) +-- +-- Maintainer: jao@gnu.org +-- Stability: unstable +-- Portability: portable +-- Created: Sat Nov 24, 2018 19:02 +-- +-- +-- The Xmobar basic type +-- +------------------------------------------------------------------------------ + + +module Xmobar.Types (X , XConf (..), runX) where + +import Graphics.X11.Xlib +import Control.Monad.Reader +import Data.Map + +import Xmobar.Config +import Xmobar.Bitmap +import Xmobar.XUtil + + +-- The Xmobar data type and basic loops and functions. + +-- | The X type is a ReaderT +type X = ReaderT XConf IO + +-- | The ReaderT inner component +data XConf = + XConf { display :: Display + , rect :: Rectangle + , window :: Window + , fontListS :: [XFont] + , verticalOffsets :: [Int] + , iconS :: Map FilePath Bitmap + , config :: Config + } + +-- | Runs the ReaderT +runX :: XConf -> X () -> IO () +runX xc f = runReaderT f xc |