DEV Community

Discussion on: Meme Monday 👁

 
corentinbettiol profile image
Corentin Bettiol

Or this if you're on *ubuntu:

your_command_here && notify-send "Success" || notify-send "Error"
Enter fullscreen mode Exit fullscreen mode

If it succeeds, the "success" notification will be sent, else the "error" notification will be sent.

Example:

1 == 1 => success
1 == 2 => error

[[ 1 == 1 ]] && notify-send "Success" || notify-send "Error"
sleep 3
[[ 1 == 2 ]] && notify-send "Success" || notify-send "Error"
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
coderamrin profile image
Amrin

Thanks man!