Thursday, May 2, 2024
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 2339  / 2 Years ago, tue, december 14, 2021, 12:05:41

I want to be noticed after a command has finished its execution. And I was thinking that if I hear a sound is a good idea.



For example, because I have a slow internet connection, the following command take long time to execute:



sudo apt-get update && sudo apt-get upgrade


So I let the terminal to run in background running the above command, but I want to hear a sound when it finished.


More From » command-line

 Answers
0

You can combine your command with a command that plays sounds. For example paplay:



sudo apt-get update && sudo apt-get upgrade; paplay /usr/share/sounds/ubuntu/stereo/message.ogg


Furthermore, if you want to play a sound if the command was successfully completed and another sound in case of an error, you can use something like:



command && paplay $(locate dialog-information.ogg) || paplay $(locate dialog-error.ogg)

[#25949] Wednesday, December 15, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ionash

Total Points: 214
Total Questions: 111
Total Answers: 116

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;