From de2d739902f4539ac4de10d3a9799124c6831559 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 8 Oct 2008 07:00:09 +0200 Subject: Make lowerOnStart configurable. Note this breaks config backwards compatibility darcs-hash:20081008050009-a5988-acb5cda2e3692295abf0bc967acc23e54b55068c.gz --- Config.hs | 3 +++ Xmobar.hs | 2 +- xmobar.config-sample | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Config.hs b/Config.hs index 8f6b687..3e76c8b 100644 --- a/Config.hs +++ b/Config.hs @@ -44,6 +44,8 @@ data Config = , bgColor :: String -- ^ Backgroud color , fgColor :: String -- ^ Default font color , position :: XPosition -- ^ Top Bottom or Static + , lowerOnStart :: Bool -- ^ Lower to the bottom of the + -- window stack on initialization , commands :: [Runnable] -- ^ For setting the command, the command arguments -- and refresh rate for the programs to run (optional) , sepChar :: String -- ^ The character to be used for indicating @@ -69,6 +71,7 @@ defaultConfig = , bgColor = "#000000" , fgColor = "#BFBFBF" , position = Top + , lowerOnStart = True , commands = [ Run $ Date "%a %b %_d %Y * %H:%M:%S" "theDate" 10 , Run StdinReader] , sepChar = "%" diff --git a/Xmobar.hs b/Xmobar.hs index 48d3fae..8246efd 100644 --- a/Xmobar.hs +++ b/Xmobar.hs @@ -135,7 +135,7 @@ createWin d fs c = do win <- newWindow d (defaultScreenOfDisplay d) rootw r o selectInput d win (exposureMask .|. structureNotifyMask) setProperties r c d win srs - lowerWindow d win + when (lowerOnStart c) (lowerWindow d win) mapWindow d win return (r,win) diff --git a/xmobar.config-sample b/xmobar.config-sample index 77f0b1f..b061459 100644 --- a/xmobar.config-sample +++ b/xmobar.config-sample @@ -2,6 +2,7 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , bgColor = "black" , fgColor = "grey" , position = Top + , lowerOnStart = True , commands = [ Run Weather "EGPF" ["-t",": C","-L","18","-H","25","--normal","green","--high","red","--low","lightblue"] 36000 , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 , Run Network "eth1" ["-L","0","-H","32","--normal","green","--high","red"] 10 -- cgit v1.2.3