diff options
| author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-21 21:46:58 +0200 |
|---|---|---|
| committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-21 21:46:58 +0200 |
| commit | 6a770605760e6c0f8ce0b204a39b194267de4f55 (patch) | |
| tree | 0333e105f64790baf3a405d35981539742efd39e /custom | |
| parent | af02d2210e3bbbe4ba9f5dae202aac35be92f244 (diff) | |
| download | nixos-6a770605760e6c0f8ce0b204a39b194267de4f55.tar nixos-6a770605760e6c0f8ce0b204a39b194267de4f55.tar.gz nixos-6a770605760e6c0f8ce0b204a39b194267de4f55.tar.bz2 nixos-6a770605760e6c0f8ce0b204a39b194267de4f55.tar.xz nixos-6a770605760e6c0f8ce0b204a39b194267de4f55.zip | |
trim summary
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" ]; |
