summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors/Common.hs')
-rw-r--r--src/Plugins/Monitors/Common.hs8
1 files changed, 7 insertions, 1 deletions
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 "</fc>") <|> try (
char '>'
return $ "<fc=" ++ s ++ ">")
+-- | Recognizes icon specification and returns it unchanged
+iconSpec :: Parser String
+iconSpec = try (do string "<icon="
+ i <- manyTill (noneOf ">") (try (string "/>"))
+ return $ "<icon=" ++ i ++ "/>")
+
-- | Parses the command part of the template string
templateCommandParser :: Parser String
templateCommandParser =