summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-08-16 20:47:21 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-08-16 20:47:21 +0200
commit0d36df3af375046554956c61089c766623104a79 (patch)
treee6ecebb6df159947c2e1f0377785fad8fed8ac03
parentfda03ea2bf02f085cd750a4b82a1964c6e8bd138 (diff)
parentb57de3e23f36756d0ba85a10592dea02561f8b0f (diff)
downloadxmobar-0d36df3af375046554956c61089c766623104a79.tar.gz
xmobar-0d36df3af375046554956c61089c766623104a79.tar.bz2
Merging github pull request 57
Conflicts: readme.md
-rw-r--r--readme.md6
-rw-r--r--src/Config.hs3
-rw-r--r--src/Parsers.hs10
-rw-r--r--src/Window.hs2
4 files changed, 15 insertions, 6 deletions
diff --git a/readme.md b/readme.md
index f0ff54a..026e70a 100644
--- a/readme.md
+++ b/readme.md
@@ -229,11 +229,15 @@ Other configuration options:
`lowerOnStart`
: When True the window is sent the bottom of the window stack initially.
+`hideOnStart`
+: When set to True the window is initially not mapped, i.e. hidden. It then
+ can be toggled manually (for example using the dbus interface) or
+ automatically (by a plugin) to make it reappear.
+
`persistent`
: When True the window status is fixed i.e. hiding or revealing is not
possible. This option can be toggled at runtime.
-
`border`
: TopB, TopBM, BottomB, BottomBM, FullB, FullBM or NoBorder (default).
diff --git a/src/Config.hs b/src/Config.hs
index 47358b0..a6ad3e2 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -55,6 +55,8 @@ data Config =
, position :: XPosition -- ^ Top Bottom or Static
, border :: Border -- ^ NoBorder TopB BottomB or FullB
, borderColor :: String -- ^ Border color
+ , hideOnStart :: Bool -- ^ Hide (Unmap) the window on
+ -- initialization
, lowerOnStart :: Bool -- ^ Lower to the bottom of the
-- window stack on initialization
, persistent :: Bool -- ^ Whether automatic hiding should
@@ -97,6 +99,7 @@ defaultConfig =
, position = Top
, border = NoBorder
, borderColor = "#BFBFBF"
+ , hideOnStart = False
, lowerOnStart = True
, persistent = False
, commands = [ Run $ Date "%a %b %_d %Y * %H:%M:%S" "theDate" 10
diff --git a/src/Parsers.hs b/src/Parsers.hs
index c92480e..c658be6 100644
--- a/src/Parsers.hs
+++ b/src/Parsers.hs
@@ -131,13 +131,14 @@ parseConfig = runParser parseConf fields "Config" . stripComments
<$?> pFont <|?> pBgColor
<|?> pFgColor <|?> pPosition
<|?> pBorder <|?> pBdColor
- <|?> pLowerOnStart <|?> pPersistent
- <|?> pCommands <|?> pSepChar
- <|?> pAlignSep <|?> pTemplate
+ <|?> pHideOnStart <|?> pLowerOnStart
+ <|?> pPersistent <|?> pCommands
+ <|?> pSepChar <|?> pAlignSep
+ <|?> pTemplate
fields = [ "font", "bgColor", "fgColor", "sepChar", "alignSep"
, "border", "borderColor" ,"template", "position"
- , "lowerOnStart", "persistent", "commands"
+ , "hideOnStart", "lowerOnStart", "persistent", "commands"
]
pFont = strField font "font"
@@ -149,6 +150,7 @@ parseConfig = runParser parseConf fields "Config" . stripComments
pTemplate = strField template "template"
pPosition = field position "position" $ tillFieldEnd >>= read' "position"
+ pHideOnStart = field hideOnStart "hideOnStart" $ tillFieldEnd >>= read' "hideOnStart"
pLowerOnStart = field lowerOnStart "lowerOnStart" $ tillFieldEnd >>= read' "lowerOnStart"
pPersistent = field persistent "persistent" $ tillFieldEnd >>= read' "persistent"
pBorder = field border "border" $ tillFieldEnd >>= read' "border"
diff --git a/src/Window.hs b/src/Window.hs
index 0ffa139..9b0c506 100644
--- a/src/Window.hs
+++ b/src/Window.hs
@@ -41,7 +41,7 @@ createWin d fs c = do
win <- newWindow d (defaultScreenOfDisplay d) rootw r o
setProperties r c d win srs
when (lowerOnStart c) (lowerWindow d win)
- mapWindow d win
+ when (not $ hideOnStart c) $ mapWindow d win
return (r,win)
-- | Updates the size and position of the window