ubuntu logo

Install undistract-me

sudo apt-get install undistract-me

Update your ~/.bashrc

$ echo 'source /etc/profile.d/undistract-me.sh' >> ~/.bashrc

Reload your Bash configuration

source ~/.bashrc

To test, execute in your terminal a command that takes more than ten seconds, to complete, e.g.

sleep 11

and navigate away from your terminal to another window.

Once the command in the terminal completes, you should receive a desktop notification with the exit status of the command and the time it took.

The threshold of ten seconds can be configured

export LONG_RUNNING_COMMAND_TIMEOUT={new-threshold-in-seconds}

If you are happy with the new configuration, add the above to ~/.bashrc or ~/.profile or similar and reload the file.