#!/bin/bash

dir=`pwd`

function mk() {
  echo "tooltip:make in $dir" >&6
  if ( make "$@" 1>&3 2>&4 ); then
    return 0
  else
    return 1
  fi
}

( ( if mk 6>&1; then
    exec >&-
    zenity --notification --window-icon="warning" --text="make succeeded in $dir"
  else
    exec >&-
    zenity --notification --window-icon="error" --text="make failed in $dir"
  fi
) | zenity --notification --text='foo' --listen ) 3>&1 4>&2
