From 4a2df063a22228274fca1bee69fa73989995be47 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Sat, 23 Feb 2013 15:05:26 +0100 Subject: Allow icons in monitor templates --- src/Plugins/Monitors/Common.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Plugins/Monitors/Common.hs b/src/Plugins/Monitors/Common.hs index 7fcab1f..0547311 100644 --- a/src/Plugins/Monitors/Common.hs +++ b/src/Plugins/Monitors/Common.hs @@ -265,7 +265,7 @@ templateStringParser = } where nonPlaceHolder = liftM concat . many $ - many1 (noneOf "<") <|> colorSpec + many1 (noneOf "<") <|> colorSpec <|> iconSpec -- | Recognizes color specification and returns it unchanged colorSpec :: Parser String @@ -275,6 +275,12 @@ colorSpec = try (string "") <|> try ( char '>' return $ "") +-- | Recognizes icon specification and returns it unchanged +iconSpec :: Parser String +iconSpec = try (do string "") (try (string "/>")) + return $ "") + -- | Parses the command part of the template string templateCommandParser :: Parser String templateCommandParser = -- cgit v1.2.3