Refactor push_tasks and add send_push,timetask functions

This commit is contained in:
mitchell 2020-08-15 19:06:43 -04:00
parent 5e8e764238
commit 2f5438dc21
3 changed files with 22 additions and 8 deletions

View file

@ -1,10 +1,4 @@
function push_tasks -a token user -d 'Push tasks as a notification to your phone'
function push_tasks -d 'Push tasks as a notification to your phone'
set tasks (task +READY export | jq 'sort_by(.urgency) | reverse | map(@text "\(.description)\nLink: \(.link)") | join("\n\n")')
set payload "{\"token\":\"$token\",\"user\":\"$user\",\"title\":\"Tasks\",\"message\":$tasks}"
curl \
-X POST \
-H 'Content-Type: application/json' \
-d $payload \
https://api.pushover.net/1/messages.json
send_push $tasks
end