0

This may sound like a silly little think (maybe it is haha), but I was thinking it would be great for my command line to be able to let me know when it's done running instead of me continually checking.

Specifically, when it completes deploying my project to firebase via the following line:

firebase deploy

Is playing a sound after my command line completes possible?

For reference, I was able to find something similar for ubuntu here.

As a side note, it'd be extra awesome if the solution could be set up to play a custom sound of my own and/or could work for when npm run build completes as well

Community
  • 1
  • 1
Rbar
  • 3,740
  • 9
  • 39
  • 69

2 Answers2

3

With 'say'

$ command && say 'task finished'
Andy Ray
  • 30,372
  • 14
  • 101
  • 138
  • `say` is standard on macOS but on many other platforms you will need to install some speech synthesis package. – tripleee Apr 27 '17 at 06:32
  • @Andy Ray. This worked perfectly for me and was far simpler than the solutions linked in the "duplicate" (whoops, sorry). +1 as this also allowed me to combine my `npm run build` command and `firebase deploy` command into one (like so `npm run build && firebase deploy && say 'task finished`), rather than me taking action in between the two! Truly wonderful. Thank you! – Rbar Apr 27 '17 at 06:42
  • the problem with this approach is that notification works only if the first command passes, the reason is the way && is implemented in shell, it stops once prev cmd fails. – Sayan Dey Sep 01 '23 at 19:24
0

I guess "Make Sound" can be any notification mechanism. If zenity is available, you could do something like :

firebase deploy
#At this point, you would like to be notified.
zenity --info --text="Firebase deployment complete" 2>/dev/null

You ll get something like

This dialogue

sjsam
  • 21,411
  • 5
  • 55
  • 102