3 ms·
I use the following in Bash. function notifyme() { MSG=${1:-'Terminal is done'} TITLE=${2:-"Done!"} osascript -e "display notification
by maerF0x0 6y ago
I use the following in Bash.
function notifyme() {
MSG=${1:-'Terminal is done'}
TITLE=${2:-"Done!"}
osascript -e "display notification \"${MSG}\" with title \"${TITLE}\""
}
I use it like:
bin/start-unit-tests; notifyme
- SwiftyBug 6y agoThis is so simple and so cool!
- ivan_ah 6y agoThis is really nice! Here is an attempt at fish port: function notifyme set MSG $argv[1] "Terminal is done" set TITLE $argv[2] "Done!" osascript -e "display notification \"$MSG[1]\" with title \"$TITLE[1]\"" end disclaimer: this is first fish function I ever write so might not be the best way to do default values; I'm using hack from https://unix.stackexchange.com/a/88682 https://unix.stackexchange.com/a/88682
- tannercollin 6y agoI wrote https://notica.us https://notica.us to do something similar. It needs a web browser open, but works over SSH and to your phone.
- maerF0x0 6y agoToo late to edit, but was rereading this and i forgot that I made optional args too. For example i sometimes leave my self next instructions notifyme "Now you can commit and push code" notifyme "Now you can commit and push code" "Tests complete"
- m463 6y agoI do something similar, but it is networked so when a compile is done on my dev machine, my main desktop shows a notification using terminal-notifier. It's very old and very hacky. There are probably apps that do this so much better. /Applications/terminal-notifier.app/Contents/MacOS/terminal-notifier -group not -title "$t" -subtitle "$st" -message "$m" -execute "$HOME/bin/gospace 1" gospace ends up doing: osascript -e 'tell application "System Events" to key code 18 using option down' which presses option-1 which switches to space 1