summaryrefslogtreecommitdiffhomepage
path: root/Main.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-04-20 02:36:39 +0200
committerAdam Vogt <vogt.adam@gmail.com>2009-04-20 02:36:39 +0200
commit8b42afe1b1aec898e147a9846bedff112dcb181b (patch)
tree14c3cd698a3eab52abfb20144983ba04eff4f1a3 /Main.hs
parente12c17c0d811606452c1b136b50585a75af7b2be (diff)
downloadxmobar-8b42afe1b1aec898e147a9846bedff112dcb181b.tar.gz
xmobar-8b42afe1b1aec898e147a9846bedff112dcb181b.tar.bz2
Add command line option for picking a screen
Ignore-this: 5d9ddc7847f9000346b2ad18f95262db darcs-hash:20090420003639-1499c-17fada63bc113031eee5cd1b87d3aea520b380df.gz
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Main.hs b/Main.hs
index e6a88a9..c8ce30d 100644
--- a/Main.hs
+++ b/Main.hs
@@ -88,6 +88,7 @@ data Opts = Help
| Commands String
| SepChar String
| Template String
+ | OnScr String
deriving Show
options :: [OptDescr Opts]
@@ -103,6 +104,7 @@ options =
, Option ['s' ] ["sepchar" ] (ReqArg SepChar "char" ) "The character used to separate commands in\nthe output template. Default '%'"
, Option ['t' ] ["template" ] (ReqArg Template "template" ) "The output template"
, Option ['c' ] ["commands" ] (ReqArg Commands "commands" ) "The list of commands to be executed"
+ , Option ['x' ] ["screen" ] (ReqArg OnScr "screen" ) "On which X screen number to start"
]
getOpts :: [String] -> IO ([Opts], [String])
@@ -142,6 +144,7 @@ doOpts conf (o:oo) =
AlignSep s -> modifyIORef conf (\c -> c { alignSep = s }) >> go
SepChar s -> modifyIORef conf (\c -> c { sepChar = s }) >> go
Template s -> modifyIORef conf (\c -> c { template = s }) >> go
+ OnScr n -> modifyIORef conf (\c -> c { position = OnScreen (read n) $ position c }) >> go
Commands s -> case readCom s of
Right x -> modifyIORef conf (\c -> c { commands = x }) >> go
Left e -> putStr (e ++ usage) >> exitWith (ExitFailure 1)