Get a notification when a terminal task finishes with undistract-me

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Message
Author
User avatar
Stevo
Developer
Posts: 14448
Joined: Fri Dec 15, 2006 7:07 pm

Get a notification when a terminal task finishes with undistract-me

#1 Post by Stevo »


User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Get a notification when a terminal task finishes with undistract-me

#2 Post by Head_on_a_Stick »

Alternative solution:

Code: Select all

$command && notify-send "Done!"
Replace $command with the desired terminal command.

EDIT: version with error detection:

Code: Select all

$command && notify-send "Done!" || notify-send "Oh no! Something went wrong :-("
EDIT2: as a shell function? Add this line to ~/.bashrc (or the initialisation file for whichever shell is in use):

Code: Select all

function notify-me {
   "$@" && notify-send "Done!" || notify-send "Oh no! Something went wrong :-("
}
Call it with:

Code: Select all

notify-me $command
mod note: Signature removed, please read the forum rules

Post Reply

Return to “Tips & Tricks by users”