Created
November 14, 2024 16:44
-
-
Save Ryel/fd23e431bdcbb04e627a8af45c27a853 to your computer and use it in GitHub Desktop.
send push notification from command line
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
| # send push notification when slow task finishes (MacOS only) | |
| # notify func as one-liner (e.g. for alias) | |
| osascript -e 'display notification "foo" with title "bar"' | |
| # add bash script with notify func | |
| { | |
| echo '#!/bin/bash' | |
| echo '/usr/bin/osascript -e "display notification \"$*\""' | |
| } | sudo tee /usr/local/bin/notify > /dev/null && sudo chmod +x /usr/local/bin/notify | |
| # example: | |
| # slow_task; notify slow_task finished |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment