Getting the name of the previous process

Make a notifier script (~/bin/notifyme)...

#!/bin/bash
(eval "$@")
notify-send "$1 finished" "Command returned $?."

...or a function (~/.bashrc):

notifyme() {
    (eval "$@")
    notify-send "$1 finished" "Command returned $?."
}

This is the easiest way.