From 6a770605760e6c0f8ce0b204a39b194267de4f55 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 21 Jul 2016 21:46:58 +0200 Subject: trim summary --- custom/notify-user.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'custom') diff --git a/custom/notify-user.nix b/custom/notify-user.nix index 0e079eb5..7eda86c9 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix @@ -11,7 +11,8 @@ stdenv.mkDerivation { import System.Environment (setEnv, getArgs) import System.Process (callProcess) - import Data.List (isPrefixOf) + import Data.List (isPrefixOf, dropWhileEnd) + import Data.Char (isSpace) import Control.Monad (forM_) @@ -20,7 +21,7 @@ stdenv.mkDerivation { forM_ envFiles $ \envFile -> do sessionAddr <- tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr - callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure <$> getContents) + callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure . dropWhileEnd isSpace <$> getContents) ''; }; phases = [ "buildPhase" "installPhase" ]; -- cgit v1.2.3