diff options
-rw-r--r-- | Config.hs | 14 | ||||
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | XMobar.hs | 8 | ||||
-rw-r--r-- | xmobar.config-sample | 4 |
4 files changed, 17 insertions, 17 deletions
@@ -23,18 +23,18 @@ module Config ( -- * Configuration -- | The configuration data type data Config = - Config { fonts :: String -- ^ Fonts + Config { font :: String -- ^ Font , bgColor :: String -- ^ Backgroud color , fgColor :: String -- ^ Default font color , xPos :: Int -- ^ x Window position (origin in the upper left corner) , yPos :: Int -- ^ y Window position , width :: Int -- ^ Window width - , hight :: Int -- ^ Window hight + , height :: Int -- ^ Window height , align :: String -- ^ text alignment , refresh :: Int -- ^ Refresh rate in tenth of seconds - , commands :: [(String, Int, [String])] -- ^ For setting the refresh rate and - -- options for the programs to run (optionals) - , sepChar :: String -- ^ The character to be used for indicating + , commands :: [(String, Int, [String])] -- ^ For setting the refresh rate and + -- options for the programs to run (optional) + , sepChar :: String -- ^ The character to be used for indicating -- commands in the output template (default '%') , template :: String -- ^ The output template } deriving (Eq, Show, Read, Ord) @@ -42,13 +42,13 @@ data Config = -- | The default configuration values defaultConfig :: Config defaultConfig = - Config { fonts = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" + Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , bgColor = "#000000" , fgColor = "#BFBFBF" , xPos = 0 , yPos = 0 , width = 1024 - , hight = 15 + , height = 15 , align = "left" , refresh = 10 , commands = [("date", 10, [])] @@ -37,16 +37,16 @@ For the output template: Other configuration options: -fonts: Name of the font to be used +font: Name of the font to be used bgColor: Backgroud color fgColor: Default font color xPos: x position (origin in the upper left corner) of the XMobar window yPos: y position width: width of the XMobar window -hight: hight +height: height align: text alignment refresh: Refresh rate in tenth of seconds -commands: For setting the options of the programs to run (optionals) +commands: For setting the options of the programs to run (optional) sepChar: The character to be used for indicating commands in the output template (default '%') template: The output template @@ -68,4 +68,4 @@ XMobars darcs repository: http://gorgias.mine.nu/repos/xmobar/ The XMonad Window Manager -http://xmonad.org
\ No newline at end of file +http://xmonad.org @@ -97,7 +97,7 @@ createWin config = (fromIntegral $ xPos config) (fromIntegral $ yPos config) (fromIntegral $ width config) - (fromIntegral $ hight config) + (fromIntegral $ height config) mapWindow dpy win return (dpy,win) @@ -113,14 +113,14 @@ drawInWin str = bgcolor <- io $ initColor dpy $ bgColor config gc <- io $ createGC dpy win --let's get the fonts - fontst <- io $ loadQueryFont dpy (fonts config) + fontst <- io $ loadQueryFont dpy (font config) io $ setFont dpy gc (fontFromFontStruct fontst) -- set window background io $ setForeground dpy gc bgcolor io $ fillRectangle dpy win gc 0 0 (fromIntegral $ width config) - (fromIntegral $ hight config) + (fromIntegral $ height config) -- write let strWithLenth = map (\(s,c) -> (s,c,textWidth fontst s)) str printStrings gc fontst 1 strWithLenth @@ -141,7 +141,7 @@ printStrings gc fontst offs sl@((s,c,l):xs) = st <- get let (_,asc,_,_) = textExtents fontst s totSLen = foldr (\(_,_,len) -> (+) len) 0 sl - valign = (fromIntegral (hight config) + fromIntegral asc) `div` 2 + valign = (fromIntegral (height config) + fromIntegral asc) `div` 2 offset = case (align config) of "center" -> (fromIntegral (width config) - fromIntegral totSLen) `div` 2 "right" -> fromIntegral (width config) - fromIntegral totSLen - 1 diff --git a/xmobar.config-sample b/xmobar.config-sample index f2b084d..5d01a82 100644 --- a/xmobar.config-sample +++ b/xmobar.config-sample @@ -1,10 +1,10 @@ -Config { fonts = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" +Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , bgColor = "#000000" , fgColor = "#BFBFBF" , xPos = 0 , yPos = 0 , width = 1024 - , hight = 15 + , height = 15 , align = "right" , refresh = 10 , commands = [("xmb-weather", 36000, ["EGPF"]), ("xmb-net", 10, ["eth0"])] |