Create A Simple Desktop Notification From Bash With notify-send

Some Bash commands take a long time to finish and provide no estimate for when that will happen. This means that you have to keep switching back to its terminal to check its status.

That’s a pain that interrupts your workflow.

Instead, use this simple command to create a popup notification on your desktop that will let you know the process has finished.

First, install libnotify on your machine.

Next, use the following simple syntax to create a desktop notification when your command has finished:

$ <COMMAND> && notify-send "Notification Message"

Here is another example using the sleep command.

sleep 3 && notify-send "Process Finished"

sleep does nothing but waits for a specified time and then exit.