ENH add icons to notifications

This commit is contained in:
Nathan Dwarshuis 2020-05-02 00:13:25 -04:00
parent 1ae1510091
commit 63f4c0c035
1 changed files with 5 additions and 2 deletions

View File

@ -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