#!/bin/bash function canexecute { EPATH=$(type -path $1) if [ -n "$EPATH" ] && [ -x "$EPATH" ] then return 0 else return 1 fi } TITLE=$1 shift if canexecute mumbles-send then mumbles-send -g localhost -s "$TITLE" "$*" #network mode ensures it works for sudo commands as well elif canexecute notify-send then notify-send "$TITLE" "$*" elif canexecute zenity then zenity --info --title="$TITLE" --text="$*" & fi