From 330a4f9562f9e71ebf680451b8ed78790b103f30 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 5 Apr 2015 11:33:08 +0900 Subject: hide aplay output --- src/Utility/Notify/Posix.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Utility/Notify/Posix.hs b/src/Utility/Notify/Posix.hs index b802356..3782405 100644 --- a/src/Utility/Notify/Posix.hs +++ b/src/Utility/Notify/Posix.hs @@ -33,7 +33,7 @@ import System.Directory (getDirectoryContents, getHomeDirectory, getModificationTime, doesDirectoryExist) import System.Environment (getEnvironment, setEnv) import System.FilePath (()) -import System.Process (readProcess, runCommand) +import System.Process (readProcessWithExitCode) import DBus (Address, parseAddress) import DBus.Client (Client, ClientError, connect) @@ -50,16 +50,17 @@ sendNotifications rems = client <- connect address mapM_ (sendNotification client) rems) -sendNotification :: Client -> Reminder -> IO Notification +sendNotification :: Client -> Reminder -> IO () sendNotification c rem = do let (title:content) = words . getReminderText $ rem soundFile <- SremConfig.notificationSound - runCommand $ "aplay " ++ soundFile notify c blankNote { appName = "srem" , body = (Just . Text . unwords) content , summary = title , expiry = Milliseconds 10000 , hints = [ SoundFile soundFile ]} + (_, _, _) <- readProcessWithExitCode "aplay" [soundFile] "" + return () getDBusUserAddress :: IO (Maybe Address) getDBusUserAddress = do -- cgit v1.2.3