summaryrefslogtreecommitdiffhomepage
path: root/src/Main.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2011-11-28 02:09:41 -0500
committerEdward Z. Yang <ezyang@mit.edu>2013-07-07 11:49:12 -0700
commita98ac8fba46b8858959cee6062a49c9121f07fe9 (patch)
tree26eb3c032be406ddf546bb8cc488d34711877889 /src/Main.hs
parented1955e4bb307c7308880d1fae4bb99a7e34d9c7 (diff)
downloadxmobar-a98ac8fba46b8858959cee6062a49c9121f07fe9.tar.gz
xmobar-a98ac8fba46b8858959cee6062a49c9121f07fe9.tar.bz2
Transparency and tint support.
New configuration option 'alpha' which adjusts alpha transparency (0 is transparent, 255 is opaque). Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index e90a158..f7a70ff 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -119,6 +119,7 @@ data Opts = Help
| Font String
| BgColor String
| FgColor String
+ | Alpha String
| T
| B
| D
@@ -139,6 +140,8 @@ options =
"The background color. Default black"
, Option "F" ["fgcolor"] (ReqArg FgColor "fg color")
"The foreground color. Default grey"
+ , Option "a" ["alpha"] (ReqArg Alpha "alpha")
+ "The transparency: 0 is transparent, 255 is opaque"
, Option "o" ["top"] (NoArg T) "Place xmobar at the top of the screen"
, Option "b" ["bottom"] (NoArg B)
"Place xmobar at the bottom of the screen"
@@ -195,6 +198,7 @@ doOpts conf (o:oo) =
Font s -> doOpts' (conf {font = s})
BgColor s -> doOpts' (conf {bgColor = s})
FgColor s -> doOpts' (conf {fgColor = s})
+ Alpha n -> doOpts' (conf {alpha = read n})
T -> doOpts' (conf {position = Top})
B -> doOpts' (conf {position = Bottom})
D -> doOpts' (conf {overrideRedirect = False})
@@ -215,4 +219,3 @@ doOpts conf (o:oo) =
"specified with the -" ++ c:" option\n")
readStr str = [x | (x,t) <- reads str, ("","") <- lex t]
doOpts' opts = doOpts opts oo
-