clean newline in mute output
parent
165195cd96
commit
24a52ffb02
|
@ -81,8 +81,14 @@ readProcessIgnoreCode cmd args stdin = do
|
||||||
(_,out,_) <- readProcessWithExitCode cmd args stdin
|
(_,out,_) <- readProcessWithExitCode cmd args stdin
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
firstWord :: String -> String
|
||||||
|
firstWord = getFirst . words
|
||||||
|
where
|
||||||
|
getFirst (x:_) = x
|
||||||
|
getFirst [] = ""
|
||||||
|
|
||||||
getMute :: String -> IO Bool
|
getMute :: String -> IO Bool
|
||||||
getMute cmd = parseMute <$> readProcessIgnoreCode cmd ["--get-mute"] ""
|
getMute cmd = parseMute . firstWord <$> readProcessIgnoreCode cmd ["--get-mute"] ""
|
||||||
where
|
where
|
||||||
parseMute "true" = True
|
parseMute "true" = True
|
||||||
parseMute "false" = False
|
parseMute "false" = False
|
||||||
|
|
Loading…
Reference in New Issue