summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/X11/Parsers.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar/X11/Parsers.hs')
-rw-r--r--src/Xmobar/X11/Parsers.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Xmobar/X11/Parsers.hs b/src/Xmobar/X11/Parsers.hs
index 4c8a130..1d486d9 100644
--- a/src/Xmobar/X11/Parsers.hs
+++ b/src/Xmobar/X11/Parsers.hs
@@ -20,6 +20,7 @@ import Xmobar.Config.Types
import Xmobar.X11.Actions
import Control.Monad (guard, mzero)
+import Data.Maybe (fromMaybe)
import Text.ParserCombinators.Parsec
import Text.Read (readMaybe)
import Graphics.X11.Types (Button)
@@ -139,7 +140,7 @@ fontParser :: ColorString -> Maybe [Action]
-> Parser [(Widget, ColorString, FontIndex, Maybe [Action])]
fontParser c a = do
f <- between (string "<fn=") (string ">") colors
- s <- manyTill (allParsers c (maybe 0 id $ readMaybe f) a) (try $ string "</fn>")
+ s <- manyTill (allParsers c (fromMaybe 0 $ readMaybe f) a) (try $ string "</fn>")
return (concat s)
-- | Parses a color specification (hex or named)