BASH script to send a pushbullet notification upon the exit of a unix shell command.
pushbullet-exit uses the
Pushbullet API v2 to send a
notification to your device when run. This can include an exit status to let
you know that your command ran successfully or not, or it can just act as
a naive indicator.
##Requirements:
curlmust be installed- Your Pushbullet Account token must be accessible to the script (see "Account Token Handling" below)
##Instructions:
- Call
pushbullet-exit.shin the terminal as you would any other shell script. - Ensure that your account token is in the appropriate place.
- To include your exit status, put
$?as the first argument like so:
./pushbullet-exit.sh $?
It's generally useful to call the script as part of a larget command, eg
make install; ./pushbullet-exit.sh $?. Remember to use ;, as && will
not run the script if the previous command fails.
##Account Token Handling This branch is reworking the handling of account tokens. Tokens are looked for in this priority:
- A
-tflag when the script is called, manually specifying the key. - An environment variable called
PUSHBULLET_ACCT_TOKEN - As the first line in
~/.config/pushbullet. This is similar to how pushbullet-bash, another pushbullet bash script on GitHub, handles tokens. - In a file called
acct-tokenin the current directory (Will be deprecated on April 1, 2015.)
##Future Features:
- A more versatile options system to better customize notifications
- Being able to pipe
stdinto the body of the notification