diff --git a/src/Monitors/Volume.hs b/src/Monitors/Volume.hs index cf11e52..0b719a7 100644 --- a/src/Monitors/Volume.hs +++ b/src/Monitors/Volume.hs @@ -81,8 +81,14 @@ readProcessIgnoreCode cmd args stdin = do (_,out,_) <- readProcessWithExitCode cmd args stdin return out +firstWord :: String -> String +firstWord = getFirst . words + where + getFirst (x:_) = x + getFirst [] = "" + getMute :: String -> IO Bool -getMute cmd = parseMute <$> readProcessIgnoreCode cmd ["--get-mute"] "" +getMute cmd = parseMute . firstWord <$> readProcessIgnoreCode cmd ["--get-mute"] "" where parseMute "true" = True parseMute "false" = False