diff options
-rw-r--r-- | custom/notify-user.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/custom/notify-user.nix b/custom/notify-user.nix index f433f4a7..f95bc43d 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix | |||
@@ -12,11 +12,15 @@ stdenv.mkDerivation { | |||
12 | 12 | ||
13 | import Data.List (isPrefixOf) | 13 | import Data.List (isPrefixOf) |
14 | 14 | ||
15 | main = shell_ $ do | 15 | import Data.Either (either) |
16 | (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" | 16 | |
17 | sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile | 17 | main = do |
18 | env <- getShellEnv | 18 | env <- shellEnv |
19 | withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline | 19 | either print return =<< runSh (env { envWorkDir = "/" } ) $ do |
20 | (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" | ||
21 | sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile | ||
22 | env <- getShellEnv | ||
23 | withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline | ||
20 | ''; }; | 24 | ''; }; |
21 | phases = [ "buildPhase" "installPhase" ]; | 25 | phases = [ "buildPhase" "installPhase" ]; |
22 | buildPhase = '' | 26 | buildPhase = '' |