I recently shifted from Elementary OS to UBUNTU 20.04 LTS. One very useful feature on Elementary OS was the terminal bell. When a command in terminal is done executing, there is a bell ring sound and a notification in the notification area.
This can be achieved by using
notify-send "Task Complete" && printf '\a' along with the original command by using
But here is the catch:
1. This command is very long and needs to be typed every time.
alias can be used but still you have to type it every time.
2. It rings this even when the terminal is in focus.
So my question is, I want a specific command to execute every time which is
notify-send "Task Complete" && printf '\a' only when terminal is out of focus. And that too without typing this every time.
Some people suggested How to make a sound once a process is complete?
But my question was to ring the bell without typing any extra command. Is there a way I could integrate some script or something in the terminal itself, so that it calls the beep sound on its own without any extra commands.