diff options
Diffstat (limited to 'custom')
-rw-r--r-- | custom/notify-user.nix | 5 |
1 files changed, 3 insertions, 2 deletions
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 { | |||
11 | import System.Environment (setEnv, getArgs) | 11 | import System.Environment (setEnv, getArgs) |
12 | import System.Process (callProcess) | 12 | import System.Process (callProcess) |
13 | 13 | ||
14 | import Data.List (isPrefixOf) | 14 | import Data.List (isPrefixOf, dropWhileEnd) |
15 | import Data.Char (isSpace) | ||
15 | 16 | ||
16 | import Control.Monad (forM_) | 17 | import Control.Monad (forM_) |
17 | 18 | ||
@@ -20,7 +21,7 @@ stdenv.mkDerivation { | |||
20 | forM_ envFiles $ \envFile -> do | 21 | forM_ envFiles $ \envFile -> do |
21 | sessionAddr <- tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile | 22 | sessionAddr <- tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile |
22 | setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr | 23 | setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr |
23 | callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure <$> getContents) | 24 | callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure . dropWhileEnd isSpace <$> getContents) |
24 | 25 | ||
25 | ''; }; | 26 | ''; }; |
26 | phases = [ "buildPhase" "installPhase" ]; | 27 | phases = [ "buildPhase" "installPhase" ]; |