From 63f4c0c0354e80ca3637f05deaa2eec113d78935 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 2 May 2020 00:13:25 -0400 Subject: [PATCH] ENH add icons to notifications --- app/rofi-devices.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/rofi-devices.hs b/app/rofi-devices.hs index a7a115c..5fbf2bd 100644 --- a/app/rofi-devices.hs +++ b/app/rofi-devices.hs @@ -489,9 +489,12 @@ umountNotify msg dir = finally -- | Send a notification indicating the mount succeeded notifyMounted :: Bool -> Bool -> String -> IO () -notifyMounted succeeded mounted label = void $ spawnProcess "notify-send" [msg] +notifyMounted succeeded mounted label = + void $ spawnProcess "notify-send" ["-i", i, msg] where - f = if succeeded then "Successfully %sed %s" else "Failed to %s %s" + (f, i) = if succeeded + then ("Successfully %sed %s", "dialog-information-symbolic") + else ("Failed to %s %s", "dialog-error-symbolic") m = if mounted then "unmount" else "mount" :: String msg = printf f m label