Created
November 7, 2024 18:31
-
-
Save yuzawa-san/7aabbcd46ed017bfbcb30984fa06b8c0 to your computer and use it in GitHub Desktop.
long running task terminal notification
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
# add to .zshrc | |
# lets me know when a long running command finishes out of view | |
# usage: my_long_command;b | |
b () { | |
local retcode=$? | |
if [[ $retcode -eq 0 ]]; then | |
osascript -e 'if not frontmost of application "Terminal" then' -e 'display notification "Command Succeeded" with title "Terminal" sound name "Glass"' -e 'end if' | |
else | |
osascript -e 'if not frontmost of application "Terminal" then' -e 'display notification "Command Failed" with title "Terminal"' -e 'end if' | |
echo '\a' | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment