How to make a sound once a process is complete?












82















I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.










share|improve this question

























  • Can you explain further what do you mean with process complete?

    – Lucio
    Apr 2 '13 at 18:21






  • 1





    @Lucio control is returned back to the terminal

    – Goaler444
    Apr 2 '13 at 18:23






  • 1





    Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

    – Lucio
    Apr 2 '13 at 18:24






  • 2





    yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

    – Goaler444
    Apr 2 '13 at 18:31
















82















I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.










share|improve this question

























  • Can you explain further what do you mean with process complete?

    – Lucio
    Apr 2 '13 at 18:21






  • 1





    @Lucio control is returned back to the terminal

    – Goaler444
    Apr 2 '13 at 18:23






  • 1





    Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

    – Lucio
    Apr 2 '13 at 18:24






  • 2





    yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

    – Goaler444
    Apr 2 '13 at 18:31














82












82








82


21






I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.










share|improve this question
















I have started a long process through a terminal. Is it possible to make the Ubuntu terminal make a sound once the process is complete? This way, I don’t need to keep checking, but will instead be notified through a sound.







command-line notification






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 30 '18 at 13:19









Ciro Santilli 新疆改造中心 六四事件 法轮功

9,46944347




9,46944347










asked Apr 2 '13 at 18:16









Goaler444Goaler444

523159




523159













  • Can you explain further what do you mean with process complete?

    – Lucio
    Apr 2 '13 at 18:21






  • 1





    @Lucio control is returned back to the terminal

    – Goaler444
    Apr 2 '13 at 18:23






  • 1





    Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

    – Lucio
    Apr 2 '13 at 18:24






  • 2





    yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

    – Goaler444
    Apr 2 '13 at 18:31



















  • Can you explain further what do you mean with process complete?

    – Lucio
    Apr 2 '13 at 18:21






  • 1





    @Lucio control is returned back to the terminal

    – Goaler444
    Apr 2 '13 at 18:23






  • 1





    Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

    – Lucio
    Apr 2 '13 at 18:24






  • 2





    yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

    – Goaler444
    Apr 2 '13 at 18:31

















Can you explain further what do you mean with process complete?

– Lucio
Apr 2 '13 at 18:21





Can you explain further what do you mean with process complete?

– Lucio
Apr 2 '13 at 18:21




1




1





@Lucio control is returned back to the terminal

– Goaler444
Apr 2 '13 at 18:23





@Lucio control is returned back to the terminal

– Goaler444
Apr 2 '13 at 18:23




1




1





Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

– Lucio
Apr 2 '13 at 18:24





Do you mean, open an application from terminal and when it finish, make a sound? Do you have an Ubuntu server or you mean GUI software?

– Lucio
Apr 2 '13 at 18:24




2




2





yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

– Goaler444
Apr 2 '13 at 18:31





yes exactly. For example i start a command line program, and once it exits and control is returned back to the terminal, a sound is made. I am currently using Ubuntu 12.10

– Goaler444
Apr 2 '13 at 18:31










9 Answers
9






active

oldest

votes


















71














There are at least three command line ways to accomplish this by putting the suiting command at the end of your script you may invoke for your lengthy process:





  1. The "classical" way to play a sound is to use beep Install beep through the PC speakers. However this will not work in all cases (e.g. in my system PC speakers are completely disabled) and you will need to remove pscpkr from /etc/modprobe/blacklist.conf and load the pcspkr kernel module.



    sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
    sudo modprobe pcspkr
    beep [optional parameters]



  2. We can also play any sound file in wav format using aplay (installed by default):



    aplay /usr/share/sounds/alsa/Side_Right.wav



  3. Another way is to use the pulseaudio command line interface to enable playback of any sound files your system (in libsndfile) recognizes on the default audio output:



     paplay /usr/share/sounds/freedesktop/stereo/complete.oga


    We can use default sound files from /usr/share/sounds/, or any other sound file we may have in a different location.






Just to have mentioned it, there is another nice way to achieve this by misusing espeak, which is installed by default in Ubuntu <= 12.04. See, or rather hear the following example:



#! /bin/bash

c=10; while [ $c -ge 0 ]; do espeak $c; let c--; done; sleep 1 ## here lengthy code
espeak "We are done with counting"


In Ubuntu >= 12.10 Orca uses speak-dispatcher. We can then install espeak Install espeak, or alternatively use spd-say "Text".






share|improve this answer





















  • 1





    @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

    – Lucio
    Apr 2 '13 at 20:55











  • @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

    – Takkat
    Apr 2 '13 at 21:07











  • @Takkat The spd-say utility is installed by default and it works on my system.

    – Lucio
    Apr 2 '13 at 21:09













  • Also take a look to this Q/A

    – c0rp
    Apr 22 '15 at 5:32






  • 1





    I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

    – Nicholas DiPiazza
    Jan 11 '17 at 19:27



















63














I use



make; spd-say done


Replace "make" with whatever long-running command you use.






share|improve this answer
























  • You just made my day!! :D

    – n0noob
    Jun 11 '15 at 17:50






  • 5





    spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    Jul 28 '16 at 11:47





















11














According to this the a character escapes ASCII code 7, which is the computer's beep.



So echo $'a' works to make a beep sound on my local machine, even when it's executed on a bash shell running on a computer I'm connected to via a terminal interface like PuTTY.






share|improve this answer



















  • 3





    amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

    – hlopetz
    Jul 28 '16 at 8:57











  • the sound of this character is disabled in most modern terminals by default

    – Blauhirn
    Mar 24 '18 at 0:05



















11
















TL;DR



To play a sound after command finishes:



long-running-command; sn3


(where sn3 is sound number 3) put this in .bashrc:



sound() {
# plays sounds in sequence and waits for them to finish
for s in $@; do
paplay $s
done
}
sn1() {
sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
}
sn2() {
sound /usr/share/sounds/freedesktop/stereo/complete.oga
}
sn3() {
sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
}


Or read below for more options:



Different sound on error and success



Here is what I use for exactly what you ask for - with one difference: it not only plays a sound when the command finishes but it plays a different sound on success and on error. (But you can change it if you don't like it.)



I have a Bash function called oks that I use at the end of long running commands:



make && make test && make install; oks


It plays a sound and displays OK or ERROR (with error code) when the previous command finishes.



Source code



Here is that function with two helpers:



sound() {
# plays sounds in sequence and waits for them to finish
for s in $@; do
paplay $s
done
}
soundbg() {
# plays all sounds at the same time in the background
for s in $@; do
# you may need to change 0 to 1 or something else:
pacmd play-file $s 0 >/dev/null
done
}
oks() {
# like ok but with sounds
s=$?
sound_ok=/usr/share/sounds/ubuntu/stereo/dialog-information.ogg
sound_error=/usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
if [[ $s = 0 ]]; then
echo OK
soundbg $sound_ok
else
echo ERROR: $s
soundbg $sound_error
fi
}


Installation



You can put it in your ~/.bashrc directly or put it in some other file and then put this line in your ~/.bashrc:



. ~/path/to/file/with/function


Configuration



Change sound_ok and sound_error to some other sounds.



You can experiment with sound vs. soundbg and change sound_ok and sound_error to use sequences of many sounds that you like to get the result that you want.



Good sounds



To find some good sounds on your system you can try:



for i in /usr/share/sounds/*/stereo/*; do echo $i; paplay $i; sleep 1; done


Here are some sounds that I often use that are available on Ubuntu by default that are good for notifications - sn1 is loud and nice, sn2 is very loud and still pretty nice, sn3 is extremely loud and not so nice:



sn1() {
sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
}
sn2() {
sound /usr/share/sounds/freedesktop/stereo/complete.oga
}
sn3() {
sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
}


Again, you can change sound to soundbg if you want to play it in the background without waiting for the sound to finish (e.g. to not slow down your scripts when you play a lot of sounds).



Silent version



And just in case - here is the same function as oks but without sounds:



ok() {
# prints OK or ERROR and exit status of previous command
s=$?
if [[ $s = 0 ]]; then
echo OK
else
echo ERROR: $s
fi
}


Usage



Here is how you use it:



Example with success:



ls / && ls /bin && ls /usr; oks


example with error:



ls / && ls /bim && ls /usr; oks


Of course in practice the commands are more like:



make && make test && make install; oks


but I used ls so you could quickly see how it works.



You can use ok instead of oks for a silent version.



Or you can use e.g.:



ls / && ls /bim && ls /usr; ok; sn1


to print OK/ERROR but always play the same sound, etc.



Update



I put those functions on GitHub, see:




  • https://github.com/rsp/scripts/blob/master/ok-functions.md


The source can be downloaded from:




  • https://rawgit.com/rsp/scripts/master/ok-functions


Update 2



I added a soundloop function to the above repo. It plays a sound and can be interrupted by Ctrl+C (unlike a simple while true; do paplay file.ogg; done that one would expect to work but it doesn't) as asked by shadi in the comments. It is implemented as:



soundloop() {
set +m
a=`date +%s`
{ paplay $1 & } 2>/dev/null
wait
b=`date +%s`
d=$(($b-$a))
[ $d -eq 0 ] && d=1
while :; do
pacmd play-file $1 0 >/dev/null
sleep $d
done
}


If you think it is complicated, please direct your complains to PulseAudio developers.






share|improve this answer


























  • I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

    – shadi
    Sep 24 '16 at 18:23











  • @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

    – rsp
    Jan 18 '17 at 21:39





















6














Expanding on Michael Curries's answer, you could make Bash print a BEL (a) character through PROMPT_COMMAND:



PROMPT_COMMAND='printf \a'


Setting PROMPT_COMMAND that way will make Bash execute printf \a at the end of each command, which will make the terminal play a sound (though as muru points out, simply triggering the redrawal of the prompt will make the terminal play the sound, i.e. the sound will be played each time a new prompt is drawn, for example even when just hitting ENTER).



This is a terminal feature, so it might not work across all terminals; for example it doesn't work in the console (but I'm sure it works in gnome-terminaland xterm).






share|improve this answer





















  • 4





    (with the caveat that every time you press Enter, you'll get a sound)

    – muru
    Mar 6 '16 at 20:27



















3














The command



 speaker-test


makes a noise sound. Simplest but annoying solution. :-)



Look at the manual of speaker-test(1) for options to configure the noise signal.






share|improve this answer

































    1














    command && (say done ; echo done) || (echo error ; say error)


    Example 1: echo alik && (say done ; echo done) || (echo error ; say error) will result in a done word.



    Example 2: non_existing_command_error && (say done ; echo done) || (echo error ; say error) will result in an error word.



    * Needs gnustep-gui-runtime -



    sudo apt-get install gnustep-gui-runtime


    Cheers.






    share|improve this answer

































      1














      This is not what you asked but you could use notification for that.



      Replace the command given in the other answers with



      notify-send "Process terminated" "Come back to the terminal, the task is over"





      share|improve this answer































        0














        I created a simple and almost-native script that plays Sound and displays a Notification with a Given Message and Time for Ubuntu (Gist):



        #!/bin/sh

        # https://gist.github.com/John-Almardeny/04fb95eeb969aa46f031457c7815b07d
        # Create a Notification With Sound with a Given Message and Time
        # The Downloaded Sound is from Notification Sounds https://notificationsounds.com/

        MSSG="$1"
        TIME="$2"

        # install wget if not found
        if ! [ -x "$(command -v wget)" ]; then
        echo -e "INSTALLING WGET...nn"
        sudo apt-get install wget
        echo -e "nn"
        fi

        # install at package if not found
        if ! [ -x "$(command -v at)" ]; then
        echo -e "INSTALLING AT...nn"
        sudo apt-get install at
        echo -e "nn"
        fi

        # install sox if not found
        if ! [ -x "$(command -v sox)" ]; then
        echo -e "INSTALLING SOX...nn"
        sudo apt-get install sox
        sudo apt-get install sox libsox-fmt-all
        echo -e "nn"
        fi

        # download the noti sound if this is first time
        # add alias to the bashrc file
        if ! [ -f ~/noti/sound.mp3 ]; then
        echo -e "DOWNLOADING SOUND...nn"
        touch ~/noti/sound.mp3 | wget -O ~/noti/sound.mp3 "https://notificationsounds.com/wake-up-tones/rise-and-shine-342/download/mp3"
        sudo echo "alias noti="sh ~/noti/noti.sh"" >> ~/.bashrc
        source ~/.bashrc
        echo -e "nn"
        fi

        # notify with the sound playing and particular given message and time
        echo "notify-send ""$MSSG"" && play ~/noti/sound.mp3" | at $TIME




        How To Use?



        First Run - Setting Up:





        1. Create a new Directory at your home and call it noti



          mkdir ~/noti


        2. Download noti.sh and extract it to the above noti dir.



        3. Open Terminal and Change Directory to noti



          cd ~/noti



        4. Make noti.sh executable by issuing:



          sudo chmod +x noti.sh



        5. Run a Test like this:



          sh ~/noti/noti.sh "Test" "now"





        Examples



        noti "Hello From Noti" "now +1 minute"
        noti "Hello From Noti" "now +5 minutes"
        noti "Hello From Noti" "now + 1 hour"
        noti "Hello From Noti" "now + 2 days"
        noti "Hello From Noti" "4 PM + 2 days"
        noti "Hello From Noti" "now + 3 weeks"
        noti "Hello From Noti" "now + 4 months"
        noti "Hello From Noti" "4:00 PM"
        noti "Hello From Noti" "2:30 AM tomorrow"
        noti "Hello From Noti" "2:30 PM Fri"
        noti "Hello From Noti" "2:30 PM 25.07.18"




        For Notifying The Finish of Process (example)



        sudo apt-get update; noti "Done" "now"





        share|improve this answer

























          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f277215%2fhow-to-make-a-sound-once-a-process-is-complete%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          9 Answers
          9






          active

          oldest

          votes








          9 Answers
          9






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          71














          There are at least three command line ways to accomplish this by putting the suiting command at the end of your script you may invoke for your lengthy process:





          1. The "classical" way to play a sound is to use beep Install beep through the PC speakers. However this will not work in all cases (e.g. in my system PC speakers are completely disabled) and you will need to remove pscpkr from /etc/modprobe/blacklist.conf and load the pcspkr kernel module.



            sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
            sudo modprobe pcspkr
            beep [optional parameters]



          2. We can also play any sound file in wav format using aplay (installed by default):



            aplay /usr/share/sounds/alsa/Side_Right.wav



          3. Another way is to use the pulseaudio command line interface to enable playback of any sound files your system (in libsndfile) recognizes on the default audio output:



             paplay /usr/share/sounds/freedesktop/stereo/complete.oga


            We can use default sound files from /usr/share/sounds/, or any other sound file we may have in a different location.






          Just to have mentioned it, there is another nice way to achieve this by misusing espeak, which is installed by default in Ubuntu <= 12.04. See, or rather hear the following example:



          #! /bin/bash

          c=10; while [ $c -ge 0 ]; do espeak $c; let c--; done; sleep 1 ## here lengthy code
          espeak "We are done with counting"


          In Ubuntu >= 12.10 Orca uses speak-dispatcher. We can then install espeak Install espeak, or alternatively use spd-say "Text".






          share|improve this answer





















          • 1





            @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

            – Lucio
            Apr 2 '13 at 20:55











          • @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

            – Takkat
            Apr 2 '13 at 21:07











          • @Takkat The spd-say utility is installed by default and it works on my system.

            – Lucio
            Apr 2 '13 at 21:09













          • Also take a look to this Q/A

            – c0rp
            Apr 22 '15 at 5:32






          • 1





            I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

            – Nicholas DiPiazza
            Jan 11 '17 at 19:27
















          71














          There are at least three command line ways to accomplish this by putting the suiting command at the end of your script you may invoke for your lengthy process:





          1. The "classical" way to play a sound is to use beep Install beep through the PC speakers. However this will not work in all cases (e.g. in my system PC speakers are completely disabled) and you will need to remove pscpkr from /etc/modprobe/blacklist.conf and load the pcspkr kernel module.



            sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
            sudo modprobe pcspkr
            beep [optional parameters]



          2. We can also play any sound file in wav format using aplay (installed by default):



            aplay /usr/share/sounds/alsa/Side_Right.wav



          3. Another way is to use the pulseaudio command line interface to enable playback of any sound files your system (in libsndfile) recognizes on the default audio output:



             paplay /usr/share/sounds/freedesktop/stereo/complete.oga


            We can use default sound files from /usr/share/sounds/, or any other sound file we may have in a different location.






          Just to have mentioned it, there is another nice way to achieve this by misusing espeak, which is installed by default in Ubuntu <= 12.04. See, or rather hear the following example:



          #! /bin/bash

          c=10; while [ $c -ge 0 ]; do espeak $c; let c--; done; sleep 1 ## here lengthy code
          espeak "We are done with counting"


          In Ubuntu >= 12.10 Orca uses speak-dispatcher. We can then install espeak Install espeak, or alternatively use spd-say "Text".






          share|improve this answer





















          • 1





            @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

            – Lucio
            Apr 2 '13 at 20:55











          • @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

            – Takkat
            Apr 2 '13 at 21:07











          • @Takkat The spd-say utility is installed by default and it works on my system.

            – Lucio
            Apr 2 '13 at 21:09













          • Also take a look to this Q/A

            – c0rp
            Apr 22 '15 at 5:32






          • 1





            I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

            – Nicholas DiPiazza
            Jan 11 '17 at 19:27














          71












          71








          71







          There are at least three command line ways to accomplish this by putting the suiting command at the end of your script you may invoke for your lengthy process:





          1. The "classical" way to play a sound is to use beep Install beep through the PC speakers. However this will not work in all cases (e.g. in my system PC speakers are completely disabled) and you will need to remove pscpkr from /etc/modprobe/blacklist.conf and load the pcspkr kernel module.



            sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
            sudo modprobe pcspkr
            beep [optional parameters]



          2. We can also play any sound file in wav format using aplay (installed by default):



            aplay /usr/share/sounds/alsa/Side_Right.wav



          3. Another way is to use the pulseaudio command line interface to enable playback of any sound files your system (in libsndfile) recognizes on the default audio output:



             paplay /usr/share/sounds/freedesktop/stereo/complete.oga


            We can use default sound files from /usr/share/sounds/, or any other sound file we may have in a different location.






          Just to have mentioned it, there is another nice way to achieve this by misusing espeak, which is installed by default in Ubuntu <= 12.04. See, or rather hear the following example:



          #! /bin/bash

          c=10; while [ $c -ge 0 ]; do espeak $c; let c--; done; sleep 1 ## here lengthy code
          espeak "We are done with counting"


          In Ubuntu >= 12.10 Orca uses speak-dispatcher. We can then install espeak Install espeak, or alternatively use spd-say "Text".






          share|improve this answer















          There are at least three command line ways to accomplish this by putting the suiting command at the end of your script you may invoke for your lengthy process:





          1. The "classical" way to play a sound is to use beep Install beep through the PC speakers. However this will not work in all cases (e.g. in my system PC speakers are completely disabled) and you will need to remove pscpkr from /etc/modprobe/blacklist.conf and load the pcspkr kernel module.



            sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
            sudo modprobe pcspkr
            beep [optional parameters]



          2. We can also play any sound file in wav format using aplay (installed by default):



            aplay /usr/share/sounds/alsa/Side_Right.wav



          3. Another way is to use the pulseaudio command line interface to enable playback of any sound files your system (in libsndfile) recognizes on the default audio output:



             paplay /usr/share/sounds/freedesktop/stereo/complete.oga


            We can use default sound files from /usr/share/sounds/, or any other sound file we may have in a different location.






          Just to have mentioned it, there is another nice way to achieve this by misusing espeak, which is installed by default in Ubuntu <= 12.04. See, or rather hear the following example:



          #! /bin/bash

          c=10; while [ $c -ge 0 ]; do espeak $c; let c--; done; sleep 1 ## here lengthy code
          espeak "We are done with counting"


          In Ubuntu >= 12.10 Orca uses speak-dispatcher. We can then install espeak Install espeak, or alternatively use spd-say "Text".







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 11 '17 at 19:03









          Community

          1




          1










          answered Apr 2 '13 at 18:40









          TakkatTakkat

          106k35249375




          106k35249375








          • 1





            @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

            – Lucio
            Apr 2 '13 at 20:55











          • @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

            – Takkat
            Apr 2 '13 at 21:07











          • @Takkat The spd-say utility is installed by default and it works on my system.

            – Lucio
            Apr 2 '13 at 21:09













          • Also take a look to this Q/A

            – c0rp
            Apr 22 '15 at 5:32






          • 1





            I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

            – Nicholas DiPiazza
            Jan 11 '17 at 19:27














          • 1





            @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

            – Lucio
            Apr 2 '13 at 20:55











          • @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

            – Takkat
            Apr 2 '13 at 21:07











          • @Takkat The spd-say utility is installed by default and it works on my system.

            – Lucio
            Apr 2 '13 at 21:09













          • Also take a look to this Q/A

            – c0rp
            Apr 22 '15 at 5:32






          • 1





            I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

            – Nicholas DiPiazza
            Jan 11 '17 at 19:27








          1




          1





          @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

          – Lucio
          Apr 2 '13 at 20:55





          @Takkat I'm using Ubuntu 12.10 and espeak is currently not installed.

          – Lucio
          Apr 2 '13 at 20:55













          @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

          – Takkat
          Apr 2 '13 at 21:07





          @Lucio: yeah, now that you say it... They switched to speak-dispatcher. If this works (it does not on my system) see edit for using spd-say.

          – Takkat
          Apr 2 '13 at 21:07













          @Takkat The spd-say utility is installed by default and it works on my system.

          – Lucio
          Apr 2 '13 at 21:09







          @Takkat The spd-say utility is installed by default and it works on my system.

          – Lucio
          Apr 2 '13 at 21:09















          Also take a look to this Q/A

          – c0rp
          Apr 22 '15 at 5:32





          Also take a look to this Q/A

          – c0rp
          Apr 22 '15 at 5:32




          1




          1





          I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

          – Nicholas DiPiazza
          Jan 11 '17 at 19:27





          I had good success with paplay /usr/share/sounds/freedesktop/stereo/complete.oga

          – Nicholas DiPiazza
          Jan 11 '17 at 19:27













          63














          I use



          make; spd-say done


          Replace "make" with whatever long-running command you use.






          share|improve this answer
























          • You just made my day!! :D

            – n0noob
            Jun 11 '15 at 17:50






          • 5





            spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Jul 28 '16 at 11:47


















          63














          I use



          make; spd-say done


          Replace "make" with whatever long-running command you use.






          share|improve this answer
























          • You just made my day!! :D

            – n0noob
            Jun 11 '15 at 17:50






          • 5





            spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Jul 28 '16 at 11:47
















          63












          63








          63







          I use



          make; spd-say done


          Replace "make" with whatever long-running command you use.






          share|improve this answer













          I use



          make; spd-say done


          Replace "make" with whatever long-running command you use.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 19 '15 at 23:58









          MemeticMemetic

          73155




          73155













          • You just made my day!! :D

            – n0noob
            Jun 11 '15 at 17:50






          • 5





            spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Jul 28 '16 at 11:47





















          • You just made my day!! :D

            – n0noob
            Jun 11 '15 at 17:50






          • 5





            spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

            – Ciro Santilli 新疆改造中心 六四事件 法轮功
            Jul 28 '16 at 11:47



















          You just made my day!! :D

          – n0noob
          Jun 11 '15 at 17:50





          You just made my day!! :D

          – n0noob
          Jun 11 '15 at 17:50




          5




          5





          spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

          – Ciro Santilli 新疆改造中心 六四事件 法轮功
          Jul 28 '16 at 11:47







          spd-say 'get back to work'. And comes pre-installed as well: releases.ubuntu.com/trusty/… , for blind people I suppose? And -w for infinite loops: while true; do spd-say -w 'get back to work you lazy bum'; done.

          – Ciro Santilli 新疆改造中心 六四事件 法轮功
          Jul 28 '16 at 11:47













          11














          According to this the a character escapes ASCII code 7, which is the computer's beep.



          So echo $'a' works to make a beep sound on my local machine, even when it's executed on a bash shell running on a computer I'm connected to via a terminal interface like PuTTY.






          share|improve this answer



















          • 3





            amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

            – hlopetz
            Jul 28 '16 at 8:57











          • the sound of this character is disabled in most modern terminals by default

            – Blauhirn
            Mar 24 '18 at 0:05
















          11














          According to this the a character escapes ASCII code 7, which is the computer's beep.



          So echo $'a' works to make a beep sound on my local machine, even when it's executed on a bash shell running on a computer I'm connected to via a terminal interface like PuTTY.






          share|improve this answer



















          • 3





            amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

            – hlopetz
            Jul 28 '16 at 8:57











          • the sound of this character is disabled in most modern terminals by default

            – Blauhirn
            Mar 24 '18 at 0:05














          11












          11








          11







          According to this the a character escapes ASCII code 7, which is the computer's beep.



          So echo $'a' works to make a beep sound on my local machine, even when it's executed on a bash shell running on a computer I'm connected to via a terminal interface like PuTTY.






          share|improve this answer













          According to this the a character escapes ASCII code 7, which is the computer's beep.



          So echo $'a' works to make a beep sound on my local machine, even when it's executed on a bash shell running on a computer I'm connected to via a terminal interface like PuTTY.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 13 '15 at 19:39









          Michael CurrieMichael Currie

          26125




          26125








          • 3





            amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

            – hlopetz
            Jul 28 '16 at 8:57











          • the sound of this character is disabled in most modern terminals by default

            – Blauhirn
            Mar 24 '18 at 0:05














          • 3





            amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

            – hlopetz
            Jul 28 '16 at 8:57











          • the sound of this character is disabled in most modern terminals by default

            – Blauhirn
            Mar 24 '18 at 0:05








          3




          3





          amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

          – hlopetz
          Jul 28 '16 at 8:57





          amazing! that's the easiest and best solution (at least for me) because it does not require to install any 3rd-party apps and can even be typed/pasted in the middle of the process to be run after command prompt will take focus.

          – hlopetz
          Jul 28 '16 at 8:57













          the sound of this character is disabled in most modern terminals by default

          – Blauhirn
          Mar 24 '18 at 0:05





          the sound of this character is disabled in most modern terminals by default

          – Blauhirn
          Mar 24 '18 at 0:05











          11
















          TL;DR



          To play a sound after command finishes:



          long-running-command; sn3


          (where sn3 is sound number 3) put this in .bashrc:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Or read below for more options:



          Different sound on error and success



          Here is what I use for exactly what you ask for - with one difference: it not only plays a sound when the command finishes but it plays a different sound on success and on error. (But you can change it if you don't like it.)



          I have a Bash function called oks that I use at the end of long running commands:



          make && make test && make install; oks


          It plays a sound and displays OK or ERROR (with error code) when the previous command finishes.



          Source code



          Here is that function with two helpers:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          soundbg() {
          # plays all sounds at the same time in the background
          for s in $@; do
          # you may need to change 0 to 1 or something else:
          pacmd play-file $s 0 >/dev/null
          done
          }
          oks() {
          # like ok but with sounds
          s=$?
          sound_ok=/usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          sound_error=/usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
          if [[ $s = 0 ]]; then
          echo OK
          soundbg $sound_ok
          else
          echo ERROR: $s
          soundbg $sound_error
          fi
          }


          Installation



          You can put it in your ~/.bashrc directly or put it in some other file and then put this line in your ~/.bashrc:



          . ~/path/to/file/with/function


          Configuration



          Change sound_ok and sound_error to some other sounds.



          You can experiment with sound vs. soundbg and change sound_ok and sound_error to use sequences of many sounds that you like to get the result that you want.



          Good sounds



          To find some good sounds on your system you can try:



          for i in /usr/share/sounds/*/stereo/*; do echo $i; paplay $i; sleep 1; done


          Here are some sounds that I often use that are available on Ubuntu by default that are good for notifications - sn1 is loud and nice, sn2 is very loud and still pretty nice, sn3 is extremely loud and not so nice:



          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Again, you can change sound to soundbg if you want to play it in the background without waiting for the sound to finish (e.g. to not slow down your scripts when you play a lot of sounds).



          Silent version



          And just in case - here is the same function as oks but without sounds:



          ok() {
          # prints OK or ERROR and exit status of previous command
          s=$?
          if [[ $s = 0 ]]; then
          echo OK
          else
          echo ERROR: $s
          fi
          }


          Usage



          Here is how you use it:



          Example with success:



          ls / && ls /bin && ls /usr; oks


          example with error:



          ls / && ls /bim && ls /usr; oks


          Of course in practice the commands are more like:



          make && make test && make install; oks


          but I used ls so you could quickly see how it works.



          You can use ok instead of oks for a silent version.



          Or you can use e.g.:



          ls / && ls /bim && ls /usr; ok; sn1


          to print OK/ERROR but always play the same sound, etc.



          Update



          I put those functions on GitHub, see:




          • https://github.com/rsp/scripts/blob/master/ok-functions.md


          The source can be downloaded from:




          • https://rawgit.com/rsp/scripts/master/ok-functions


          Update 2



          I added a soundloop function to the above repo. It plays a sound and can be interrupted by Ctrl+C (unlike a simple while true; do paplay file.ogg; done that one would expect to work but it doesn't) as asked by shadi in the comments. It is implemented as:



          soundloop() {
          set +m
          a=`date +%s`
          { paplay $1 & } 2>/dev/null
          wait
          b=`date +%s`
          d=$(($b-$a))
          [ $d -eq 0 ] && d=1
          while :; do
          pacmd play-file $1 0 >/dev/null
          sleep $d
          done
          }


          If you think it is complicated, please direct your complains to PulseAudio developers.






          share|improve this answer


























          • I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

            – shadi
            Sep 24 '16 at 18:23











          • @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

            – rsp
            Jan 18 '17 at 21:39


















          11
















          TL;DR



          To play a sound after command finishes:



          long-running-command; sn3


          (where sn3 is sound number 3) put this in .bashrc:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Or read below for more options:



          Different sound on error and success



          Here is what I use for exactly what you ask for - with one difference: it not only plays a sound when the command finishes but it plays a different sound on success and on error. (But you can change it if you don't like it.)



          I have a Bash function called oks that I use at the end of long running commands:



          make && make test && make install; oks


          It plays a sound and displays OK or ERROR (with error code) when the previous command finishes.



          Source code



          Here is that function with two helpers:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          soundbg() {
          # plays all sounds at the same time in the background
          for s in $@; do
          # you may need to change 0 to 1 or something else:
          pacmd play-file $s 0 >/dev/null
          done
          }
          oks() {
          # like ok but with sounds
          s=$?
          sound_ok=/usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          sound_error=/usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
          if [[ $s = 0 ]]; then
          echo OK
          soundbg $sound_ok
          else
          echo ERROR: $s
          soundbg $sound_error
          fi
          }


          Installation



          You can put it in your ~/.bashrc directly or put it in some other file and then put this line in your ~/.bashrc:



          . ~/path/to/file/with/function


          Configuration



          Change sound_ok and sound_error to some other sounds.



          You can experiment with sound vs. soundbg and change sound_ok and sound_error to use sequences of many sounds that you like to get the result that you want.



          Good sounds



          To find some good sounds on your system you can try:



          for i in /usr/share/sounds/*/stereo/*; do echo $i; paplay $i; sleep 1; done


          Here are some sounds that I often use that are available on Ubuntu by default that are good for notifications - sn1 is loud and nice, sn2 is very loud and still pretty nice, sn3 is extremely loud and not so nice:



          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Again, you can change sound to soundbg if you want to play it in the background without waiting for the sound to finish (e.g. to not slow down your scripts when you play a lot of sounds).



          Silent version



          And just in case - here is the same function as oks but without sounds:



          ok() {
          # prints OK or ERROR and exit status of previous command
          s=$?
          if [[ $s = 0 ]]; then
          echo OK
          else
          echo ERROR: $s
          fi
          }


          Usage



          Here is how you use it:



          Example with success:



          ls / && ls /bin && ls /usr; oks


          example with error:



          ls / && ls /bim && ls /usr; oks


          Of course in practice the commands are more like:



          make && make test && make install; oks


          but I used ls so you could quickly see how it works.



          You can use ok instead of oks for a silent version.



          Or you can use e.g.:



          ls / && ls /bim && ls /usr; ok; sn1


          to print OK/ERROR but always play the same sound, etc.



          Update



          I put those functions on GitHub, see:




          • https://github.com/rsp/scripts/blob/master/ok-functions.md


          The source can be downloaded from:




          • https://rawgit.com/rsp/scripts/master/ok-functions


          Update 2



          I added a soundloop function to the above repo. It plays a sound and can be interrupted by Ctrl+C (unlike a simple while true; do paplay file.ogg; done that one would expect to work but it doesn't) as asked by shadi in the comments. It is implemented as:



          soundloop() {
          set +m
          a=`date +%s`
          { paplay $1 & } 2>/dev/null
          wait
          b=`date +%s`
          d=$(($b-$a))
          [ $d -eq 0 ] && d=1
          while :; do
          pacmd play-file $1 0 >/dev/null
          sleep $d
          done
          }


          If you think it is complicated, please direct your complains to PulseAudio developers.






          share|improve this answer


























          • I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

            – shadi
            Sep 24 '16 at 18:23











          • @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

            – rsp
            Jan 18 '17 at 21:39
















          11












          11








          11









          TL;DR



          To play a sound after command finishes:



          long-running-command; sn3


          (where sn3 is sound number 3) put this in .bashrc:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Or read below for more options:



          Different sound on error and success



          Here is what I use for exactly what you ask for - with one difference: it not only plays a sound when the command finishes but it plays a different sound on success and on error. (But you can change it if you don't like it.)



          I have a Bash function called oks that I use at the end of long running commands:



          make && make test && make install; oks


          It plays a sound and displays OK or ERROR (with error code) when the previous command finishes.



          Source code



          Here is that function with two helpers:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          soundbg() {
          # plays all sounds at the same time in the background
          for s in $@; do
          # you may need to change 0 to 1 or something else:
          pacmd play-file $s 0 >/dev/null
          done
          }
          oks() {
          # like ok but with sounds
          s=$?
          sound_ok=/usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          sound_error=/usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
          if [[ $s = 0 ]]; then
          echo OK
          soundbg $sound_ok
          else
          echo ERROR: $s
          soundbg $sound_error
          fi
          }


          Installation



          You can put it in your ~/.bashrc directly or put it in some other file and then put this line in your ~/.bashrc:



          . ~/path/to/file/with/function


          Configuration



          Change sound_ok and sound_error to some other sounds.



          You can experiment with sound vs. soundbg and change sound_ok and sound_error to use sequences of many sounds that you like to get the result that you want.



          Good sounds



          To find some good sounds on your system you can try:



          for i in /usr/share/sounds/*/stereo/*; do echo $i; paplay $i; sleep 1; done


          Here are some sounds that I often use that are available on Ubuntu by default that are good for notifications - sn1 is loud and nice, sn2 is very loud and still pretty nice, sn3 is extremely loud and not so nice:



          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Again, you can change sound to soundbg if you want to play it in the background without waiting for the sound to finish (e.g. to not slow down your scripts when you play a lot of sounds).



          Silent version



          And just in case - here is the same function as oks but without sounds:



          ok() {
          # prints OK or ERROR and exit status of previous command
          s=$?
          if [[ $s = 0 ]]; then
          echo OK
          else
          echo ERROR: $s
          fi
          }


          Usage



          Here is how you use it:



          Example with success:



          ls / && ls /bin && ls /usr; oks


          example with error:



          ls / && ls /bim && ls /usr; oks


          Of course in practice the commands are more like:



          make && make test && make install; oks


          but I used ls so you could quickly see how it works.



          You can use ok instead of oks for a silent version.



          Or you can use e.g.:



          ls / && ls /bim && ls /usr; ok; sn1


          to print OK/ERROR but always play the same sound, etc.



          Update



          I put those functions on GitHub, see:




          • https://github.com/rsp/scripts/blob/master/ok-functions.md


          The source can be downloaded from:




          • https://rawgit.com/rsp/scripts/master/ok-functions


          Update 2



          I added a soundloop function to the above repo. It plays a sound and can be interrupted by Ctrl+C (unlike a simple while true; do paplay file.ogg; done that one would expect to work but it doesn't) as asked by shadi in the comments. It is implemented as:



          soundloop() {
          set +m
          a=`date +%s`
          { paplay $1 & } 2>/dev/null
          wait
          b=`date +%s`
          d=$(($b-$a))
          [ $d -eq 0 ] && d=1
          while :; do
          pacmd play-file $1 0 >/dev/null
          sleep $d
          done
          }


          If you think it is complicated, please direct your complains to PulseAudio developers.






          share|improve this answer

















          TL;DR



          To play a sound after command finishes:



          long-running-command; sn3


          (where sn3 is sound number 3) put this in .bashrc:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Or read below for more options:



          Different sound on error and success



          Here is what I use for exactly what you ask for - with one difference: it not only plays a sound when the command finishes but it plays a different sound on success and on error. (But you can change it if you don't like it.)



          I have a Bash function called oks that I use at the end of long running commands:



          make && make test && make install; oks


          It plays a sound and displays OK or ERROR (with error code) when the previous command finishes.



          Source code



          Here is that function with two helpers:



          sound() {
          # plays sounds in sequence and waits for them to finish
          for s in $@; do
          paplay $s
          done
          }
          soundbg() {
          # plays all sounds at the same time in the background
          for s in $@; do
          # you may need to change 0 to 1 or something else:
          pacmd play-file $s 0 >/dev/null
          done
          }
          oks() {
          # like ok but with sounds
          s=$?
          sound_ok=/usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          sound_error=/usr/share/sounds/ubuntu/stereo/dialog-warning.ogg
          if [[ $s = 0 ]]; then
          echo OK
          soundbg $sound_ok
          else
          echo ERROR: $s
          soundbg $sound_error
          fi
          }


          Installation



          You can put it in your ~/.bashrc directly or put it in some other file and then put this line in your ~/.bashrc:



          . ~/path/to/file/with/function


          Configuration



          Change sound_ok and sound_error to some other sounds.



          You can experiment with sound vs. soundbg and change sound_ok and sound_error to use sequences of many sounds that you like to get the result that you want.



          Good sounds



          To find some good sounds on your system you can try:



          for i in /usr/share/sounds/*/stereo/*; do echo $i; paplay $i; sleep 1; done


          Here are some sounds that I often use that are available on Ubuntu by default that are good for notifications - sn1 is loud and nice, sn2 is very loud and still pretty nice, sn3 is extremely loud and not so nice:



          sn1() {
          sound /usr/share/sounds/ubuntu/stereo/dialog-information.ogg
          }
          sn2() {
          sound /usr/share/sounds/freedesktop/stereo/complete.oga
          }
          sn3() {
          sound /usr/share/sounds/freedesktop/stereo/suspend-error.oga
          }


          Again, you can change sound to soundbg if you want to play it in the background without waiting for the sound to finish (e.g. to not slow down your scripts when you play a lot of sounds).



          Silent version



          And just in case - here is the same function as oks but without sounds:



          ok() {
          # prints OK or ERROR and exit status of previous command
          s=$?
          if [[ $s = 0 ]]; then
          echo OK
          else
          echo ERROR: $s
          fi
          }


          Usage



          Here is how you use it:



          Example with success:



          ls / && ls /bin && ls /usr; oks


          example with error:



          ls / && ls /bim && ls /usr; oks


          Of course in practice the commands are more like:



          make && make test && make install; oks


          but I used ls so you could quickly see how it works.



          You can use ok instead of oks for a silent version.



          Or you can use e.g.:



          ls / && ls /bim && ls /usr; ok; sn1


          to print OK/ERROR but always play the same sound, etc.



          Update



          I put those functions on GitHub, see:




          • https://github.com/rsp/scripts/blob/master/ok-functions.md


          The source can be downloaded from:




          • https://rawgit.com/rsp/scripts/master/ok-functions


          Update 2



          I added a soundloop function to the above repo. It plays a sound and can be interrupted by Ctrl+C (unlike a simple while true; do paplay file.ogg; done that one would expect to work but it doesn't) as asked by shadi in the comments. It is implemented as:



          soundloop() {
          set +m
          a=`date +%s`
          { paplay $1 & } 2>/dev/null
          wait
          b=`date +%s`
          d=$(($b-$a))
          [ $d -eq 0 ] && d=1
          while :; do
          pacmd play-file $1 0 >/dev/null
          sleep $d
          done
          }


          If you think it is complicated, please direct your complains to PulseAudio developers.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 18 '17 at 21:38

























          answered Apr 1 '15 at 19:24









          rsprsp

          2,07011110




          2,07011110













          • I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

            – shadi
            Sep 24 '16 at 18:23











          • @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

            – rsp
            Jan 18 '17 at 21:39





















          • I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

            – shadi
            Sep 24 '16 at 18:23











          • @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

            – rsp
            Jan 18 '17 at 21:39



















          I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

          – shadi
          Sep 24 '16 at 18:23





          I tried to put this in a while true; do paplay ...; done so that the sound repeats until I hit Ctrl+C, but when I do, it doesn't break. I can't find any special options in man paplay to figure out how to get this to work. Any ideas?

          – shadi
          Sep 24 '16 at 18:23













          @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

          – rsp
          Jan 18 '17 at 21:39







          @shadi See my updated answer for a solution with a sound that repeats until you hit Ctrl+C.

          – rsp
          Jan 18 '17 at 21:39













          6














          Expanding on Michael Curries's answer, you could make Bash print a BEL (a) character through PROMPT_COMMAND:



          PROMPT_COMMAND='printf \a'


          Setting PROMPT_COMMAND that way will make Bash execute printf \a at the end of each command, which will make the terminal play a sound (though as muru points out, simply triggering the redrawal of the prompt will make the terminal play the sound, i.e. the sound will be played each time a new prompt is drawn, for example even when just hitting ENTER).



          This is a terminal feature, so it might not work across all terminals; for example it doesn't work in the console (but I'm sure it works in gnome-terminaland xterm).






          share|improve this answer





















          • 4





            (with the caveat that every time you press Enter, you'll get a sound)

            – muru
            Mar 6 '16 at 20:27
















          6














          Expanding on Michael Curries's answer, you could make Bash print a BEL (a) character through PROMPT_COMMAND:



          PROMPT_COMMAND='printf \a'


          Setting PROMPT_COMMAND that way will make Bash execute printf \a at the end of each command, which will make the terminal play a sound (though as muru points out, simply triggering the redrawal of the prompt will make the terminal play the sound, i.e. the sound will be played each time a new prompt is drawn, for example even when just hitting ENTER).



          This is a terminal feature, so it might not work across all terminals; for example it doesn't work in the console (but I'm sure it works in gnome-terminaland xterm).






          share|improve this answer





















          • 4





            (with the caveat that every time you press Enter, you'll get a sound)

            – muru
            Mar 6 '16 at 20:27














          6












          6








          6







          Expanding on Michael Curries's answer, you could make Bash print a BEL (a) character through PROMPT_COMMAND:



          PROMPT_COMMAND='printf \a'


          Setting PROMPT_COMMAND that way will make Bash execute printf \a at the end of each command, which will make the terminal play a sound (though as muru points out, simply triggering the redrawal of the prompt will make the terminal play the sound, i.e. the sound will be played each time a new prompt is drawn, for example even when just hitting ENTER).



          This is a terminal feature, so it might not work across all terminals; for example it doesn't work in the console (but I'm sure it works in gnome-terminaland xterm).






          share|improve this answer















          Expanding on Michael Curries's answer, you could make Bash print a BEL (a) character through PROMPT_COMMAND:



          PROMPT_COMMAND='printf \a'


          Setting PROMPT_COMMAND that way will make Bash execute printf \a at the end of each command, which will make the terminal play a sound (though as muru points out, simply triggering the redrawal of the prompt will make the terminal play the sound, i.e. the sound will be played each time a new prompt is drawn, for example even when just hitting ENTER).



          This is a terminal feature, so it might not work across all terminals; for example it doesn't work in the console (but I'm sure it works in gnome-terminaland xterm).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 6 '16 at 20:30

























          answered Mar 6 '16 at 20:25









          koskos

          25.4k870121




          25.4k870121








          • 4





            (with the caveat that every time you press Enter, you'll get a sound)

            – muru
            Mar 6 '16 at 20:27














          • 4





            (with the caveat that every time you press Enter, you'll get a sound)

            – muru
            Mar 6 '16 at 20:27








          4




          4





          (with the caveat that every time you press Enter, you'll get a sound)

          – muru
          Mar 6 '16 at 20:27





          (with the caveat that every time you press Enter, you'll get a sound)

          – muru
          Mar 6 '16 at 20:27











          3














          The command



           speaker-test


          makes a noise sound. Simplest but annoying solution. :-)



          Look at the manual of speaker-test(1) for options to configure the noise signal.






          share|improve this answer






























            3














            The command



             speaker-test


            makes a noise sound. Simplest but annoying solution. :-)



            Look at the manual of speaker-test(1) for options to configure the noise signal.






            share|improve this answer




























              3












              3








              3







              The command



               speaker-test


              makes a noise sound. Simplest but annoying solution. :-)



              Look at the manual of speaker-test(1) for options to configure the noise signal.






              share|improve this answer















              The command



               speaker-test


              makes a noise sound. Simplest but annoying solution. :-)



              Look at the manual of speaker-test(1) for options to configure the noise signal.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 1 '15 at 10:21









              David Foerster

              28k1365110




              28k1365110










              answered Nov 1 '15 at 8:01









              xerostomusxerostomus

              37647




              37647























                  1














                  command && (say done ; echo done) || (echo error ; say error)


                  Example 1: echo alik && (say done ; echo done) || (echo error ; say error) will result in a done word.



                  Example 2: non_existing_command_error && (say done ; echo done) || (echo error ; say error) will result in an error word.



                  * Needs gnustep-gui-runtime -



                  sudo apt-get install gnustep-gui-runtime


                  Cheers.






                  share|improve this answer






























                    1














                    command && (say done ; echo done) || (echo error ; say error)


                    Example 1: echo alik && (say done ; echo done) || (echo error ; say error) will result in a done word.



                    Example 2: non_existing_command_error && (say done ; echo done) || (echo error ; say error) will result in an error word.



                    * Needs gnustep-gui-runtime -



                    sudo apt-get install gnustep-gui-runtime


                    Cheers.






                    share|improve this answer




























                      1












                      1








                      1







                      command && (say done ; echo done) || (echo error ; say error)


                      Example 1: echo alik && (say done ; echo done) || (echo error ; say error) will result in a done word.



                      Example 2: non_existing_command_error && (say done ; echo done) || (echo error ; say error) will result in an error word.



                      * Needs gnustep-gui-runtime -



                      sudo apt-get install gnustep-gui-runtime


                      Cheers.






                      share|improve this answer















                      command && (say done ; echo done) || (echo error ; say error)


                      Example 1: echo alik && (say done ; echo done) || (echo error ; say error) will result in a done word.



                      Example 2: non_existing_command_error && (say done ; echo done) || (echo error ; say error) will result in an error word.



                      * Needs gnustep-gui-runtime -



                      sudo apt-get install gnustep-gui-runtime


                      Cheers.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited May 23 '16 at 11:33









                      muru

                      1




                      1










                      answered May 23 '16 at 11:23









                      AlikElzin-kilakaAlikElzin-kilaka

                      2,1991932




                      2,1991932























                          1














                          This is not what you asked but you could use notification for that.



                          Replace the command given in the other answers with



                          notify-send "Process terminated" "Come back to the terminal, the task is over"





                          share|improve this answer




























                            1














                            This is not what you asked but you could use notification for that.



                            Replace the command given in the other answers with



                            notify-send "Process terminated" "Come back to the terminal, the task is over"





                            share|improve this answer


























                              1












                              1








                              1







                              This is not what you asked but you could use notification for that.



                              Replace the command given in the other answers with



                              notify-send "Process terminated" "Come back to the terminal, the task is over"





                              share|improve this answer













                              This is not what you asked but you could use notification for that.



                              Replace the command given in the other answers with



                              notify-send "Process terminated" "Come back to the terminal, the task is over"






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 30 '18 at 14:07









                              solsTiCesolsTiCe

                              6,01922048




                              6,01922048























                                  0














                                  I created a simple and almost-native script that plays Sound and displays a Notification with a Given Message and Time for Ubuntu (Gist):



                                  #!/bin/sh

                                  # https://gist.github.com/John-Almardeny/04fb95eeb969aa46f031457c7815b07d
                                  # Create a Notification With Sound with a Given Message and Time
                                  # The Downloaded Sound is from Notification Sounds https://notificationsounds.com/

                                  MSSG="$1"
                                  TIME="$2"

                                  # install wget if not found
                                  if ! [ -x "$(command -v wget)" ]; then
                                  echo -e "INSTALLING WGET...nn"
                                  sudo apt-get install wget
                                  echo -e "nn"
                                  fi

                                  # install at package if not found
                                  if ! [ -x "$(command -v at)" ]; then
                                  echo -e "INSTALLING AT...nn"
                                  sudo apt-get install at
                                  echo -e "nn"
                                  fi

                                  # install sox if not found
                                  if ! [ -x "$(command -v sox)" ]; then
                                  echo -e "INSTALLING SOX...nn"
                                  sudo apt-get install sox
                                  sudo apt-get install sox libsox-fmt-all
                                  echo -e "nn"
                                  fi

                                  # download the noti sound if this is first time
                                  # add alias to the bashrc file
                                  if ! [ -f ~/noti/sound.mp3 ]; then
                                  echo -e "DOWNLOADING SOUND...nn"
                                  touch ~/noti/sound.mp3 | wget -O ~/noti/sound.mp3 "https://notificationsounds.com/wake-up-tones/rise-and-shine-342/download/mp3"
                                  sudo echo "alias noti="sh ~/noti/noti.sh"" >> ~/.bashrc
                                  source ~/.bashrc
                                  echo -e "nn"
                                  fi

                                  # notify with the sound playing and particular given message and time
                                  echo "notify-send ""$MSSG"" && play ~/noti/sound.mp3" | at $TIME




                                  How To Use?



                                  First Run - Setting Up:





                                  1. Create a new Directory at your home and call it noti



                                    mkdir ~/noti


                                  2. Download noti.sh and extract it to the above noti dir.



                                  3. Open Terminal and Change Directory to noti



                                    cd ~/noti



                                  4. Make noti.sh executable by issuing:



                                    sudo chmod +x noti.sh



                                  5. Run a Test like this:



                                    sh ~/noti/noti.sh "Test" "now"





                                  Examples



                                  noti "Hello From Noti" "now +1 minute"
                                  noti "Hello From Noti" "now +5 minutes"
                                  noti "Hello From Noti" "now + 1 hour"
                                  noti "Hello From Noti" "now + 2 days"
                                  noti "Hello From Noti" "4 PM + 2 days"
                                  noti "Hello From Noti" "now + 3 weeks"
                                  noti "Hello From Noti" "now + 4 months"
                                  noti "Hello From Noti" "4:00 PM"
                                  noti "Hello From Noti" "2:30 AM tomorrow"
                                  noti "Hello From Noti" "2:30 PM Fri"
                                  noti "Hello From Noti" "2:30 PM 25.07.18"




                                  For Notifying The Finish of Process (example)



                                  sudo apt-get update; noti "Done" "now"





                                  share|improve this answer






























                                    0














                                    I created a simple and almost-native script that plays Sound and displays a Notification with a Given Message and Time for Ubuntu (Gist):



                                    #!/bin/sh

                                    # https://gist.github.com/John-Almardeny/04fb95eeb969aa46f031457c7815b07d
                                    # Create a Notification With Sound with a Given Message and Time
                                    # The Downloaded Sound is from Notification Sounds https://notificationsounds.com/

                                    MSSG="$1"
                                    TIME="$2"

                                    # install wget if not found
                                    if ! [ -x "$(command -v wget)" ]; then
                                    echo -e "INSTALLING WGET...nn"
                                    sudo apt-get install wget
                                    echo -e "nn"
                                    fi

                                    # install at package if not found
                                    if ! [ -x "$(command -v at)" ]; then
                                    echo -e "INSTALLING AT...nn"
                                    sudo apt-get install at
                                    echo -e "nn"
                                    fi

                                    # install sox if not found
                                    if ! [ -x "$(command -v sox)" ]; then
                                    echo -e "INSTALLING SOX...nn"
                                    sudo apt-get install sox
                                    sudo apt-get install sox libsox-fmt-all
                                    echo -e "nn"
                                    fi

                                    # download the noti sound if this is first time
                                    # add alias to the bashrc file
                                    if ! [ -f ~/noti/sound.mp3 ]; then
                                    echo -e "DOWNLOADING SOUND...nn"
                                    touch ~/noti/sound.mp3 | wget -O ~/noti/sound.mp3 "https://notificationsounds.com/wake-up-tones/rise-and-shine-342/download/mp3"
                                    sudo echo "alias noti="sh ~/noti/noti.sh"" >> ~/.bashrc
                                    source ~/.bashrc
                                    echo -e "nn"
                                    fi

                                    # notify with the sound playing and particular given message and time
                                    echo "notify-send ""$MSSG"" && play ~/noti/sound.mp3" | at $TIME




                                    How To Use?



                                    First Run - Setting Up:





                                    1. Create a new Directory at your home and call it noti



                                      mkdir ~/noti


                                    2. Download noti.sh and extract it to the above noti dir.



                                    3. Open Terminal and Change Directory to noti



                                      cd ~/noti



                                    4. Make noti.sh executable by issuing:



                                      sudo chmod +x noti.sh



                                    5. Run a Test like this:



                                      sh ~/noti/noti.sh "Test" "now"





                                    Examples



                                    noti "Hello From Noti" "now +1 minute"
                                    noti "Hello From Noti" "now +5 minutes"
                                    noti "Hello From Noti" "now + 1 hour"
                                    noti "Hello From Noti" "now + 2 days"
                                    noti "Hello From Noti" "4 PM + 2 days"
                                    noti "Hello From Noti" "now + 3 weeks"
                                    noti "Hello From Noti" "now + 4 months"
                                    noti "Hello From Noti" "4:00 PM"
                                    noti "Hello From Noti" "2:30 AM tomorrow"
                                    noti "Hello From Noti" "2:30 PM Fri"
                                    noti "Hello From Noti" "2:30 PM 25.07.18"




                                    For Notifying The Finish of Process (example)



                                    sudo apt-get update; noti "Done" "now"





                                    share|improve this answer




























                                      0












                                      0








                                      0







                                      I created a simple and almost-native script that plays Sound and displays a Notification with a Given Message and Time for Ubuntu (Gist):



                                      #!/bin/sh

                                      # https://gist.github.com/John-Almardeny/04fb95eeb969aa46f031457c7815b07d
                                      # Create a Notification With Sound with a Given Message and Time
                                      # The Downloaded Sound is from Notification Sounds https://notificationsounds.com/

                                      MSSG="$1"
                                      TIME="$2"

                                      # install wget if not found
                                      if ! [ -x "$(command -v wget)" ]; then
                                      echo -e "INSTALLING WGET...nn"
                                      sudo apt-get install wget
                                      echo -e "nn"
                                      fi

                                      # install at package if not found
                                      if ! [ -x "$(command -v at)" ]; then
                                      echo -e "INSTALLING AT...nn"
                                      sudo apt-get install at
                                      echo -e "nn"
                                      fi

                                      # install sox if not found
                                      if ! [ -x "$(command -v sox)" ]; then
                                      echo -e "INSTALLING SOX...nn"
                                      sudo apt-get install sox
                                      sudo apt-get install sox libsox-fmt-all
                                      echo -e "nn"
                                      fi

                                      # download the noti sound if this is first time
                                      # add alias to the bashrc file
                                      if ! [ -f ~/noti/sound.mp3 ]; then
                                      echo -e "DOWNLOADING SOUND...nn"
                                      touch ~/noti/sound.mp3 | wget -O ~/noti/sound.mp3 "https://notificationsounds.com/wake-up-tones/rise-and-shine-342/download/mp3"
                                      sudo echo "alias noti="sh ~/noti/noti.sh"" >> ~/.bashrc
                                      source ~/.bashrc
                                      echo -e "nn"
                                      fi

                                      # notify with the sound playing and particular given message and time
                                      echo "notify-send ""$MSSG"" && play ~/noti/sound.mp3" | at $TIME




                                      How To Use?



                                      First Run - Setting Up:





                                      1. Create a new Directory at your home and call it noti



                                        mkdir ~/noti


                                      2. Download noti.sh and extract it to the above noti dir.



                                      3. Open Terminal and Change Directory to noti



                                        cd ~/noti



                                      4. Make noti.sh executable by issuing:



                                        sudo chmod +x noti.sh



                                      5. Run a Test like this:



                                        sh ~/noti/noti.sh "Test" "now"





                                      Examples



                                      noti "Hello From Noti" "now +1 minute"
                                      noti "Hello From Noti" "now +5 minutes"
                                      noti "Hello From Noti" "now + 1 hour"
                                      noti "Hello From Noti" "now + 2 days"
                                      noti "Hello From Noti" "4 PM + 2 days"
                                      noti "Hello From Noti" "now + 3 weeks"
                                      noti "Hello From Noti" "now + 4 months"
                                      noti "Hello From Noti" "4:00 PM"
                                      noti "Hello From Noti" "2:30 AM tomorrow"
                                      noti "Hello From Noti" "2:30 PM Fri"
                                      noti "Hello From Noti" "2:30 PM 25.07.18"




                                      For Notifying The Finish of Process (example)



                                      sudo apt-get update; noti "Done" "now"





                                      share|improve this answer















                                      I created a simple and almost-native script that plays Sound and displays a Notification with a Given Message and Time for Ubuntu (Gist):



                                      #!/bin/sh

                                      # https://gist.github.com/John-Almardeny/04fb95eeb969aa46f031457c7815b07d
                                      # Create a Notification With Sound with a Given Message and Time
                                      # The Downloaded Sound is from Notification Sounds https://notificationsounds.com/

                                      MSSG="$1"
                                      TIME="$2"

                                      # install wget if not found
                                      if ! [ -x "$(command -v wget)" ]; then
                                      echo -e "INSTALLING WGET...nn"
                                      sudo apt-get install wget
                                      echo -e "nn"
                                      fi

                                      # install at package if not found
                                      if ! [ -x "$(command -v at)" ]; then
                                      echo -e "INSTALLING AT...nn"
                                      sudo apt-get install at
                                      echo -e "nn"
                                      fi

                                      # install sox if not found
                                      if ! [ -x "$(command -v sox)" ]; then
                                      echo -e "INSTALLING SOX...nn"
                                      sudo apt-get install sox
                                      sudo apt-get install sox libsox-fmt-all
                                      echo -e "nn"
                                      fi

                                      # download the noti sound if this is first time
                                      # add alias to the bashrc file
                                      if ! [ -f ~/noti/sound.mp3 ]; then
                                      echo -e "DOWNLOADING SOUND...nn"
                                      touch ~/noti/sound.mp3 | wget -O ~/noti/sound.mp3 "https://notificationsounds.com/wake-up-tones/rise-and-shine-342/download/mp3"
                                      sudo echo "alias noti="sh ~/noti/noti.sh"" >> ~/.bashrc
                                      source ~/.bashrc
                                      echo -e "nn"
                                      fi

                                      # notify with the sound playing and particular given message and time
                                      echo "notify-send ""$MSSG"" && play ~/noti/sound.mp3" | at $TIME




                                      How To Use?



                                      First Run - Setting Up:





                                      1. Create a new Directory at your home and call it noti



                                        mkdir ~/noti


                                      2. Download noti.sh and extract it to the above noti dir.



                                      3. Open Terminal and Change Directory to noti



                                        cd ~/noti



                                      4. Make noti.sh executable by issuing:



                                        sudo chmod +x noti.sh



                                      5. Run a Test like this:



                                        sh ~/noti/noti.sh "Test" "now"





                                      Examples



                                      noti "Hello From Noti" "now +1 minute"
                                      noti "Hello From Noti" "now +5 minutes"
                                      noti "Hello From Noti" "now + 1 hour"
                                      noti "Hello From Noti" "now + 2 days"
                                      noti "Hello From Noti" "4 PM + 2 days"
                                      noti "Hello From Noti" "now + 3 weeks"
                                      noti "Hello From Noti" "now + 4 months"
                                      noti "Hello From Noti" "4:00 PM"
                                      noti "Hello From Noti" "2:30 AM tomorrow"
                                      noti "Hello From Noti" "2:30 PM Fri"
                                      noti "Hello From Noti" "2:30 PM 25.07.18"




                                      For Notifying The Finish of Process (example)



                                      sudo apt-get update; noti "Done" "now"






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Jul 10 '18 at 20:41

























                                      answered Jul 10 '18 at 14:02









                                      YahyaYahya

                                      1114




                                      1114






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Ask Ubuntu!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f277215%2fhow-to-make-a-sound-once-a-process-is-complete%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Category:香港粉麵

                                          List *all* the tuples!

                                          Channel [V]