function drush_notify_send_text

8.0.x drush_notify_send_text($msg)
6.x drush_notify_send_text($msg)
7.x drush_notify_send_text($msg)
master drush_notify_send_text($msg)

Send text-based system notification.

This is the automatic, default behavior. It is intended for use with tools such as libnotify in Linux and Notification Center on OSX.


string $msg: Message text for delivery.

Return value

bool TRUE on success, FALSE on failure

1 call to drush_notify_send_text()
drush_notify_send in commands/core/
Prepares and dispatches notifications to delivery mechanisms.


commands/core/, line 134
Add system notifications as a new drush option.


function drush_notify_send_text($msg) {
  $override = drush_get_option('notify-cmd', FALSE);

  if (!empty($override)) {
    $cmd = $override;
  else {
    switch (PHP_OS) {
      case 'Darwin':
        $cmd = 'terminal-notifier -message %s -title Drush';
        $error_message = dt('terminal-notifier command failed. Please install it from');
      case 'Linux':
        $icon = drush_normalize_path(DRUSH_BASE_PATH . '/drush_logo-black.png');
        $cmd = "notify-send %s -i $icon";
        $error_message = dt('notify-send command failed. Please install it as per');

  if (!drush_shell_exec($cmd, $msg)) {
    return drush_set_error('NOTIFY_COMMAND_NOT_FOUND', $error_message . ' ' . dt('Or you may specify an alternate command to run by specifying --notify-cmd=<my_command>'));

  return TRUE;