I would like to always receive a visual notification when a process has finished in a terminal window. Example of such a process:

youtube-dl -cit --extract-audio --audio-format mp3 https://www.youtube.com/....
  • 1
    Would something like this work for you? sleep 30 ; xmessage -center "Sleep 30 Done" Where you substitute sleep 30 with your command and enter the text you like between the double quotes? Basically, it's two commands executed in sequence. That's what the ; stands for: it separates two commands. – jawtheshark Aug 22 '16 at 15:23
  • Thank you! I would prefer this type of notification, however. – orschiro Aug 22 '16 at 15:27
  • Probably doable with some DBus magic... Let's see if Google yields anything... – jawtheshark Aug 22 '16 at 15:34
  • What process? A specific one that you've started? Any process running on the system? Any process started by your user? Also, should the notification depend on whether the process finished successfully or failed or was stopped? Please edit your question and clarify. – terdon Aug 22 '16 at 15:40
  • Didn't you ask a related question some months ago? That time it was about making a notification like the one some other OS (Elementary) provided and you were pointed to alert in Ubuntu's .bashrc. – DK Bose Aug 22 '16 at 15:41

Use this:

yourlongrunningcommand ; notify-send "Yay! We're done!  Off to the bar!"

To understand the command:

  • The ; denoted sequential execution. First execute yourlongrunningcommand and when done, execute the next command... which is
  • notify-send, which is nothing more than the type of notification you wanted as per our comment exchange

I just googled to know that second part. I found this on askubuntu.com.

Not the answer you're looking for? Browse other questions tagged or ask your own question.