summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/notify-user.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/custom/notify-user.nix b/custom/notify-user.nix
index e3437ea7..bf03f72f 100644
--- a/custom/notify-user.nix
+++ b/custom/notify-user.nix
@@ -13,9 +13,11 @@ stdenv.mkDerivation {
13 13
14 import Data.List (isPrefixOf) 14 import Data.List (isPrefixOf)
15 15
16 import Control.Monad (forM_)
17
16 main = do 18 main = do
17 envFiles <- glob "/home/${user}/.dbus/session-bus/*" 19 envFiles <- glob "/home/${user}/.dbus/session-bus/*"
18 forM envFiles $ \envFile -> do 20 forM_ envFiles $ \envFile -> do
19 sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile 21 sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile
20 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr 22 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr
21 callProcess "${libnotify}/bin/notify-send" =<< getArgs 23 callProcess "${libnotify}/bin/notify-send" =<< getArgs