From 479a50b9e291ea5cd59e7df6a12fc537b4220254 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 18 Dec 2019 15:11:31 +0000 Subject: linting and doom background --- src/lib/GMPDP.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib/GMPDP.hs') diff --git a/src/lib/GMPDP.hs b/src/lib/GMPDP.hs index 370e360..d7e36de 100644 --- a/src/lib/GMPDP.hs +++ b/src/lib/GMPDP.hs @@ -7,14 +7,13 @@ module GMPDP where import Data.Aeson import Data.Text import Control.Applicative -import Control.Monad import qualified Data.ByteString.Lazy as B import Network.HTTP.Conduit (simpleHttp) import GHC.Generics import Xmobar -import Control.Monad (when) +import Control.Monad (when, guard) import Control.Concurrent.STM import Control.Exception (SomeException (..), handle, evaluate) @@ -61,7 +60,7 @@ getGMPDPStatus = do Left _ -> return Nothing Right r -> return $ Just r -data GMPDP = GMPDP String deriving (Show,Read,Generic) +newtype GMPDP = GMPDP String deriving (Show,Read,Generic) handleNotification :: TVar (Maybe GMPDPStatus) -> Event -> IO () handleNotification v _ = @@ -70,8 +69,8 @@ handleNotification v _ = formatStatus Nothing = "" formatStatus (Just s) = fmtt (current $ time s) ++ "/" ++ fmtt (total $ time s) ++ - " " ++ (title $ song s) ++ " " ++ (album $ song s) ++ "" ++ - " " ++ (artist $ song s) + " " ++ title (song s) ++ " " ++ album (song s) ++ "" ++ + " " ++ artist (song s) where fmtt ms = let s = ms `div` 1000 sr x = if x < 10 then "0" ++ show x else show x in sr (s `div` 60) ++ ":" ++ sr (s `mod` 60) -- cgit v1.2.3