summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Config.hs6
-rw-r--r--Main.hs16
-rw-r--r--Xmobar.hs22
3 files changed, 22 insertions, 22 deletions
diff --git a/Config.hs b/Config.hs
index 7044a22..aff4db6 100644
--- a/Config.hs
+++ b/Config.hs
@@ -44,8 +44,8 @@ data Config =
, template :: String -- ^ The output template
} deriving (Read)
-data XPosition = Top Width | Bottom Width | Static {xpos, ypos, width, height :: Int} deriving ( Read, Eq )
-data Width = A | L Int | R Int | C Int deriving ( Read, Eq )
+data XPosition = Top | TopW Width | Bottom | BottomW Width | Static {xpos, ypos, width, height :: Int} deriving ( Read, Eq )
+data Width = L Int | R Int | C Int deriving ( Read, Eq )
-- | The default configuration values
defaultConfig :: Config
@@ -53,7 +53,7 @@ defaultConfig =
Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
, bgColor = "#000000"
, fgColor = "#BFBFBF"
- , position = Top A
+ , position = Top
, commands = []
, sepChar = "%"
, alignSep = "}{"
diff --git a/Main.hs b/Main.hs
index bf31d3b..2381373 100644
--- a/Main.hs
+++ b/Main.hs
@@ -132,14 +132,14 @@ doOpts conf (o:oo) =
case o of
Help -> putStr usage >> exitWith ExitSuccess
Version -> putStrLn version >> exitWith ExitSuccess
- Font s -> modifyIORef conf (\c -> c { font = s }) >> go
- BgColor s -> modifyIORef conf (\c -> c { bgColor = s }) >> go
- FgColor s -> modifyIORef conf (\c -> c { fgColor = s }) >> go
- T -> modifyIORef conf (\c -> c { position = Top A }) >> go
- B -> modifyIORef conf (\c -> c { position = Bottom A}) >> go
- AlignSep s -> modifyIORef conf (\c -> c { alignSep = s }) >> go
- SepChar s -> modifyIORef conf (\c -> c { sepChar = s }) >> go
- Template s -> modifyIORef conf (\c -> c { template = s }) >> go
+ Font s -> modifyIORef conf (\c -> c { font = s }) >> go
+ BgColor s -> modifyIORef conf (\c -> c { bgColor = s }) >> go
+ FgColor s -> modifyIORef conf (\c -> c { fgColor = s }) >> go
+ T -> modifyIORef conf (\c -> c { position = Top }) >> go
+ B -> modifyIORef conf (\c -> c { position = Bottom}) >> go
+ AlignSep s -> modifyIORef conf (\c -> c { alignSep = s }) >> go
+ SepChar s -> modifyIORef conf (\c -> c { sepChar = s }) >> go
+ Template s -> modifyIORef conf (\c -> c { template = s }) >> go
Commands s -> case readCom s of
Right x -> modifyIORef conf (\c -> c { commands = x }) >> go
Left e -> putStr (e ++ usage) >> exitWith (ExitFailure 1)
diff --git a/Xmobar.hs b/Xmobar.hs
index e26d2f7..4545dcd 100644
--- a/Xmobar.hs
+++ b/Xmobar.hs
@@ -144,14 +144,14 @@ createWin d fs c = do
setPosition :: XPosition -> Rectangle -> Dimension -> (Position,Position,Dimension,Dimension,Bool)
setPosition p (Rectangle rx ry rw rh) ht =
case p of
- Top A -> (rx , ry , rw , h , True)
- Top (L i) -> (rx , ry , nw i , h , True)
- Top (R i) -> (right i, ry , nw i , h , True)
- Top (C i) -> (center i, ry , nw i , h , True)
- Bottom A -> (rx , ny , rw , h , True)
- Bottom (L i) -> (rx , ny , nw i , h , True)
- Bottom (R i) -> (right i, ny , nw i , h , True)
- Bottom (C i) -> (center i, ny , nw i , h , True)
+ Top -> (rx , ry , rw , h , True)
+ TopW (L i) -> (rx , ry , nw i , h , True)
+ TopW (R i) -> (right i, ry , nw i , h , True)
+ TopW (C i) -> (center i, ry , nw i , h , True)
+ Bottom -> (rx , ny , rw , h , True)
+ BottomW (L i) -> (rx , ny , nw i , h , True)
+ BottomW (R i) -> (right i, ny , nw i , h , True)
+ BottomW (C i) -> (center i, ny , nw i , h , True)
Static cx cy cw ch -> (fi cx , fi cy , fi cw, fi ch, True)
where
ny = ry + fi (rh - ht)
@@ -175,9 +175,9 @@ setProperties h c d w = do
getStrutValues :: Dimension -> Config -> [Int]
getStrutValues h c =
case position c of
- Top _ -> [0, 0, fi h, 0 ]
- Bottom _ -> [0, 0, 0 , fi h]
- _ -> [0, 0, 0 , 0 ]
+ Top -> [0, 0, fi h, 0 ]
+ Bottom -> [0, 0, 0 , fi h]
+ _ -> [0, 0, 0 , 0 ]
updateWin :: TVar String -> X ()
updateWin v = do