Skip to content

Instantly share code, notes, and snippets.

@yuzawa-san
Created November 7, 2024 18:31
Show Gist options
  • Save yuzawa-san/7aabbcd46ed017bfbcb30984fa06b8c0 to your computer and use it in GitHub Desktop.
Save yuzawa-san/7aabbcd46ed017bfbcb30984fa06b8c0 to your computer and use it in GitHub Desktop.
long running task terminal notification
# 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