mikaelbr/gulp-notify

Disable the sound

newtonianb opened this issue · 4 comments

This sound blows up in my ear every time there's an error on recompilation. Its insanely loud compared to other sounds on my machine.
How can I disable this sound before I become deaf?

I'm trying to pass it as an argument but keep getting an error

var $ = require('gulp-load-plugins')();

module.exports = function (errorObject, callback) {
    $.notify({
        sound: false
    }).onError(errorObject.toString().split(': ').join(':\n')).apply(this, arguments);
node_modules\gulp-iconfont\node_modules\gulp-ttf2woff2\node_modules\ttf2woff2\jssrc\ttf2woff2.js:1
aughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Mod
                                                                    ^
TypeError: undefined is not a function

The proper usage would be:

var $ = require('gulp-load-plugins')();

module.exports = function (errorObject, callback) {
    $.notify.onError({
        sound: false,
        message: errorObject.toString().split(': ').join(':\n')
    }).apply(this, arguments);

Or just

var $ = require('gulp-load-plugins')();

module.exports = $.notify.onError({
  sound: false,
  message: function (error) {
    return errorObject.toString().split(': ').join(':\n');
  }
});

as

$.notify({
  sound: false
})

would return a stream which you can pipe things into. Read more about the API/usage here: https://github.com/mikaelbr/gulp-notify#notifyonerror

You can probably change the volume of your notifications through what ever notification system you are using. Be it notification center or on KDE/Gnome notifications or Growl.

Thanks very much that worked