summaryrefslogtreecommitdiffhomepage
path: root/src/Main.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2017-12-15 03:32:27 +0100
committerjao <jao@gnu.org>2017-12-15 03:32:27 +0100
commitb89668884f021e1023160febb680a43588a6aeaa (patch)
treeec625019888664efb6c7502b754269daebab16db /src/Main.hs
parenta7bc612666062b5c48efae74054a453334727e91 (diff)
downloadxmobar-b89668884f021e1023160febb680a43588a6aeaa.tar.gz
xmobar-b89668884f021e1023160febb680a43588a6aeaa.tar.bz2
Configurable WM_CLASS and WM_NAME (should address #323)
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 3760353..0c96688 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -135,6 +135,8 @@ data Opts = Help
| OnScr String
| IconRoot String
| Position String
+ | WmClass String
+ | WmName String
deriving Show
options :: [OptDescr Opts]
@@ -142,6 +144,8 @@ options =
[ Option "h?" ["help"] (NoArg Help) "This help"
, Option "V" ["version"] (NoArg Version) "Show version information"
, Option "f" ["font"] (ReqArg Font "font name") "The font name"
+ , Option "w" ["wmclass"] (ReqArg WmClass "class") "X11 WM_CLASS property"
+ , Option "n" ["wmname"] (ReqArg WmName "name") "X11 WM_NAME property"
, Option "B" ["bgcolor"] (ReqArg BgColor "bg color" )
"The background color. Default black"
, Option "F" ["fgcolor"] (ReqArg FgColor "fg color")
@@ -206,6 +210,8 @@ doOpts conf (o:oo) =
Help -> putStr usage >> exitSuccess
Version -> putStrLn info >> exitSuccess
Font s -> doOpts' (conf {font = s})
+ WmClass s -> doOpts' (conf {wmClass = s})
+ WmName s -> doOpts' (conf {wmName = s})
BgColor s -> doOpts' (conf {bgColor = s})
FgColor s -> doOpts' (conf {fgColor = s})
Alpha n -> doOpts' (conf {alpha = read n})