Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Last active October 26, 2018 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e-minguez/9cb95ed0e1de81da485b59348f14d5ef to your computer and use it in GitHub Desktop.
Save e-minguez/9cb95ed0e1de81da485b59348f14d5ef to your computer and use it in GitHub Desktop.
This snippet is to be used as `my_time_consuming_command && pushbullet "title" "finished"`
#!/bin/bash
TOKEN="xxx"
TITLE=${1:-TITLE}
MESSAGE=${2:-MESSAGE}
curl --header "Access-Token: ${TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary "{\"body\":\"${MESSAGE}\",\"title\":\"${TITLE}\",\"type\":\"note\"}" \
--request POST --silent -o /dev/null \
https://api.pushbullet.com/v2/pushes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment