Sometimes it’s useful to get visual feedback from a script. For example, when a script or cron job completes, a long-running build fails, or there is an urgent problem during script execution. Desktop applications can do this with pop-up notifications, but it can be done from a script too! You can use script commands to send yourself desktop notifications and reminders.
It can also be used from any CLI based applications that need to pop up a desktop GUI notification. I actually found the command already installed on my Manjaro Linux, but it could be from an application that was already installed and using it.
The below code has been written and tested on Linux. It can also be done on macOS with a bit of effort.
See https://opensource.com/article/22/1/linux-desktop-notifications