Created
September 6, 2023 02:12
-
-
Save njenan/8627f54b1ac089915d67582c0bf40a79 to your computer and use it in GitHub Desktop.
OSX Zsh Desktop Notify and Wait and Notify Functions
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
function notify() { | |
osascript -e "display notification \"$1\" with title \"Alert\"" | |
} | |
function wait-and-notify() { | |
until eval "$1" | |
do | |
sleep 2 | |
done | |
MSG="${2:-$1 returned 0}" | |
notify $MSG | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment