How to make the Terminal make a noise on command completion?

user364819

Let's say I run a command which takes a long time to do its stuff, but I don't want or need to look at it the whole time, and as I need to do some other stuff as well I might get into that and forget to check on how the command is doing for some time... Then when I finally do check I may find that the command finished 3 hours ago and needed my attention then... Or perhaps it didn't need my attention, if I had seen that it had finished at the time I would have had more time to run more commands...

So I was wondering if there is a way to get it so that when a command or program has been run, whenever it finishes and returns to $, for it to make a little sound, like play an mp3 file or something? Though it would be acceptable just to get this working in gnome-terminal, I would like it in as many CLI environments as possible including the TTYs if that would be possible... I am running Ubuntu GNOME 15.10 with GNOME 3.18.

mchid

First, run the following commands to enable pcspkr and to install beep:

sudo sed -i 's/blacklist pcspkr/#blacklist pcspkr/g' /etc/modprobe.d/blacklist.conf
sudo modprobe pcspkr
sudo apt-get install beep

Now, run a command along with beep like so:

sudo apt-get update; beep

or

sudo apt-get update; beep;beep;beep;beep;beep

Finally, to control the volume of beep, change the beep volume from alsamixer by running the following command:

alsamixer

Now, use your right arrow key to scroll to the automute option. Use the up arrow to toggle this off.

Then use the left arrow key to scroll to beep and use the up or down arrow key to raise or lower the volume of beep.

Use the M key to mute or un-mute any channel.

Press ESC to exit alsamixer

Many more options for beep can be found at:

man beep

EDIT

Now, to get the terminal to beep after each command is run, run the following command:

cp .bashrc .bashbackup
echo 'PROMPT_COMMAND="beep"' | tee -a .bashrc
. .bashrc

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to make terminal recognize command "gvim" or "mvim"?

From Dev

How to make local .command Terminal script?

From Dev

how to make an application to run from a command in terminal

From Dev

Prevent completion of files for 'make' command in zsh shell

From Dev

How to make a smoother Perlin noise generator?

From Dev

How to make and draw a Perlin Noise on a JPanel

From Dev

How to make the terminal autoclose when a command runs successfully?

From Dev

How to make the top bar of my terminal say what command is running?

From Dev

How to make the top bar of my terminal say what command is running?

From Dev

How to make the terminal autoclose when a command runs successfully?

From Dev

How to make ps command to show user, PID, terminal, CMD

From Dev

How to make the terminal prompt make sound every time i am prompted to write a command?

From Dev

How can I make zsh completion behave like Bash completion?

From Dev

How to make bash completion ignore certain directories?

From Dev

How to make a image visible after completion of Thread?

From Dev

How to make a image visible after completion of Thread?

From Dev

How to make lftp auto completion case insensitive?

From Dev

how to make shortcut with command?

From Dev

How to make an alias for a command?

From Dev

how to make shortcut with command?

From Dev

Is there a way to make vim run the "make" command in another terminal window?

From Dev

How to make Terminal settings to default?

From Dev

How to make Terminal settings to default?

From Dev

how to make terminal prompt messages?

From Dev

How to make username in terminal smaller?

From Dev

How can I make a smoother my heightmap? (Perlin noise, openGL)

From Dev

Using perlin noise to make a map?

From Dev

How download make and set "make" as a command?

From Dev

How do I make "make" a command?

Related Related

  1. 1

    How to make terminal recognize command "gvim" or "mvim"?

  2. 2

    How to make local .command Terminal script?

  3. 3

    how to make an application to run from a command in terminal

  4. 4

    Prevent completion of files for 'make' command in zsh shell

  5. 5

    How to make a smoother Perlin noise generator?

  6. 6

    How to make and draw a Perlin Noise on a JPanel

  7. 7

    How to make the terminal autoclose when a command runs successfully?

  8. 8

    How to make the top bar of my terminal say what command is running?

  9. 9

    How to make the top bar of my terminal say what command is running?

  10. 10

    How to make the terminal autoclose when a command runs successfully?

  11. 11

    How to make ps command to show user, PID, terminal, CMD

  12. 12

    How to make the terminal prompt make sound every time i am prompted to write a command?

  13. 13

    How can I make zsh completion behave like Bash completion?

  14. 14

    How to make bash completion ignore certain directories?

  15. 15

    How to make a image visible after completion of Thread?

  16. 16

    How to make a image visible after completion of Thread?

  17. 17

    How to make lftp auto completion case insensitive?

  18. 18

    how to make shortcut with command?

  19. 19

    How to make an alias for a command?

  20. 20

    how to make shortcut with command?

  21. 21

    Is there a way to make vim run the "make" command in another terminal window?

  22. 22

    How to make Terminal settings to default?

  23. 23

    How to make Terminal settings to default?

  24. 24

    how to make terminal prompt messages?

  25. 25

    How to make username in terminal smaller?

  26. 26

    How can I make a smoother my heightmap? (Perlin noise, openGL)

  27. 27

    Using perlin noise to make a map?

  28. 28

    How download make and set "make" as a command?

  29. 29

    How do I make "make" a command?

HotTag

Archive