Created
March 16, 2022 16:20
-
-
Save CodeMouse92/1563c8e606c8e87a673e3784379c8f69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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