From a8d3dc60312400f2fc238d1d14224e3408b553b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 22 Jul 2016 14:18:25 +0200 Subject: drop exit status --- custom/notify-user.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom/notify-user.nix b/custom/notify-user.nix index 6bfd8593..917c2b7f 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix @@ -11,13 +11,13 @@ stdenv.mkDerivation { import System.FilePath.Glob (glob) import System.Environment (setEnv, getArgs) - import System.Process (callProcess) + import System.Process (spawnProcess, waitForProcess) import System.Exit (exitWith, ExitCode(..)) import Data.List (isPrefixOf, dropWhile, dropWhileEnd) import Data.Char (isSpace) - import Control.Monad (forM_) + import Control.Monad (forM_, void) main = do envFiles <- glob "/home/${user}/.dbus/session-bus/*" @@ -27,7 +27,9 @@ stdenv.mkDerivation { lines <- lines <$> getContents case lines of [] -> exitWith ExitSuccess - ((trim -> summary):(trim . unlines -> contents)) -> callProcess "${libnotify}/bin/notify-send" =<< (++ [summary, contents]) <$> getArgs + ((trim -> summary):(trim . unlines -> contents)) -> do + ph <- spawnProcess "${libnotify}/bin/notify-send" =<< (++ [summary, contents]) <$> getArgs + void $ waitForProcess ph where trim = dropWhileEnd isSpace . dropWhile isSpace ''; }; -- cgit v1.2.3