summaryrefslogtreecommitdiff
path: root/custom/notify-user.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:06:31 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:06:31 +0200
commit0a6b4afd95b381b44e59717839250e2bcbe248a1 (patch)
tree494f75ad029f4544c733ebbf9798cb3c29704232 /custom/notify-user.hs
parent54a7458a16580cae7d17d6c0ca2050504e3b476f (diff)
downloadnixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.gz
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.bz2
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.xz
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.zip
...
Diffstat (limited to 'custom/notify-user.hs')
-rw-r--r--custom/notify-user.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/custom/notify-user.hs b/custom/notify-user.hs
index f9cc2369..264d6f86 100644
--- a/custom/notify-user.hs
+++ b/custom/notify-user.hs
@@ -24,7 +24,7 @@ deriving instance Read Notify.Urgency
24 24
25main :: IO () 25main :: IO ()
26main = do 26main = do
27 envFiles <- glob "@userHome@/.dbus/session-bus/*" 27 envFiles <- glob "@home@/.dbus/session-bus/*"
28 forM_ envFiles $ \envFile -> do 28 forM_ envFiles $ \envFile -> do
29 sessionAddr <- unQuote . tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile 29 sessionAddr <- unQuote . tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile
30 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr 30 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr
@@ -37,7 +37,7 @@ main = do
37 ] 37 ]
38 let 38 let
39 urgency = fromMaybe Notify.Normal $ readMaybe . caseForRead =<< Map.lookup "urgency" opts 39 urgency = fromMaybe Notify.Normal $ readMaybe . caseForRead =<< Map.lookup "urgency" opts
40 appName = fromMaybe "notify-@userName@" $ Map.lookup "app-name" opts 40 appName = fromMaybe "notify-@user@" $ Map.lookup "app-name" opts
41 category = fromMaybe "" $ Map.lookup "category" opts 41 category = fromMaybe "" $ Map.lookup "category" opts
42 Notify.display_ $ Notify.summary summary <> Notify.body contents <> Notify.appName appName <> Notify.urgency urgency <> Notify.category category 42 Notify.display_ $ Notify.summary summary <> Notify.body contents <> Notify.appName appName <> Notify.urgency urgency <> Notify.category category
43 _ -> exitWith $ ExitFailure 2 43 _ -> exitWith $ ExitFailure 2