summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-06 19:35:13 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-01-06 19:35:13 +0100
commit91a1bc6c311cbf1efc48cde59a593ddf65409a5c (patch)
treee5dfeba36256f9464b1a11bc1d83986d8dc1816c
parentae8a67090f60cc9aeb623bcc79e0df1af0d7f8eb (diff)
downloadxmobar-91a1bc6c311cbf1efc48cde59a593ddf65409a5c.tar.gz
xmobar-91a1bc6c311cbf1efc48cde59a593ddf65409a5c.tar.bz2
Mail now takes its alias as a second argument
This way we also avoid issue 30, although we're not solving the real issue (which is that the commands parser cannot correctly parse commands with a single argument unless they appear at the end of the list).
-rw-r--r--README11
-rw-r--r--src/Main.hs2
-rw-r--r--src/Plugins/Mail.hs5
3 files changed, 12 insertions, 6 deletions
diff --git a/README b/README
index d066933..b83a7f0 100644
--- a/README
+++ b/README
@@ -575,15 +575,20 @@ Monitors have default aliases.
"<composer> <title> (<album>) <track>/<plength> <statei> ",
"--", "-P", ">>", "-Z", "|", "-S", "><"] 10
-`Mail Args`
+`Mail Args Alias`
-- Aliases to `Mail`
- Args: list of maildirs in form
- `[("name1","path1"),("name2","path2")]`. Paths may start with a '~'
+ `[("name1","path1"),...]`. Paths may start with a '~'
to expand to the user's home directory.
- This plugin requires inotify support in your linux kernel and the
[hinotify] package. To activate, pass `--flags="with_inotify"`
during compilation.
+- Example:
+
+ Run Mail [("inbox", "~/var/mail/inbox"),
+ ("lists", "~/var/mail/lists")]
+ "mail"
+
`MBox Mboxes Opts Alias`
diff --git a/src/Main.hs b/src/Main.hs
index 2719a79..aad87e7 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -125,7 +125,7 @@ usage = (usageInfo header options) ++ footer
info :: String
info = "xmobar " ++ showVersion version
++ "\n (C) 2007 - 2010 Andrea Rossato "
- ++ "\n (C) 2010 Jose A Ortega Ruiz\n "
+ ++ "\n (C) 2010 - 2011 Jose A Ortega Ruiz\n "
++ mail ++ "\n" ++ license
mail :: String
diff --git a/src/Plugins/Mail.hs b/src/Plugins/Mail.hs
index 38cdaae..58431ce 100644
--- a/src/Plugins/Mail.hs
+++ b/src/Plugins/Mail.hs
@@ -30,11 +30,12 @@ import Data.Set (Set)
import qualified Data.Set as S
-- | A list of mail box names and paths to maildirs.
-data Mail = Mail [(String, FilePath)]
+data Mail = Mail [(String, FilePath)] String
deriving (Read, Show)
instance Exec Mail where
- start (Mail ms) cb = do
+ alias (Mail _ a) = a
+ start (Mail ms _) cb = do
vs <- mapM (const $ newTVarIO S.empty) ms
let ts = map fst ms