Last active
July 30, 2025 23:39
-
-
Save somewhatabstract/fae01eb628c5975f1d551a8ea9b28d40 to your computer and use it in GitHub Desktop.
Simple bash commands for displaying notifications/alerts on macOS; useful for adding a toast on command completions
This file contains hidden or 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
notify() { | |
osascript -e "display notification \"$2\" with title \"$1\" sound name \"${3:-default}\"" | |
} | |
alert() { | |
("$@" && notify "✅ Success!" "$(echo "$@")" Blow) || notify "⚠️ Oh noes!" "$(echo "$@")" Sosumi | |
} | |
alias 🚨=alert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment