Skip to content

Instantly share code, notes, and snippets.

@CodeMouse92
Created March 16, 2022 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodeMouse92/1563c8e606c8e87a673e3784379c8f69 to your computer and use it in GitHub Desktop.
Save CodeMouse92/1563c8e606c8e87a673e3784379c8f69 to your computer and use it in GitHub Desktop.
# Do you keep forgetting about long-running processes on your machine,
# and you wind up stuck on something else while waiting?
# This bash function will remind you when your long-running process is done.
# 1. Ensure zenity is installed on your system (or modify the script below)
# 2. Add the following bash function to your shell profile (e.g. .bashrc)
hey() {
$@
ret=$?
if test $ret -eq 0
then
zenity --info --text "Hey! Your process finished successfully."
else
zenity --error --text "Hey! Your process failed with return code ${ret}."
fi
}
# 3. Source your profile or restart your shell session.
# 4. (USAGE) Invoke literally ANY command with 'hey' in front.
# For example, 'hey sudo docker-compose -f local.yml build'
# You will get a popup notification when it is completed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment