Skip to content

Instantly share code, notes, and snippets.

@redraw
Last active May 8, 2020 02:49
Show Gist options
  • Save redraw/758167bf15a207b69b8de0754052fe03 to your computer and use it in GitHub Desktop.
Save redraw/758167bf15a207b69b8de0754052fe03 to your computer and use it in GitHub Desktop.
dirty desktop script to notify iss
#/bin/sh
date_from_ts () { date --date=@$1 +'%H:%M %D'; }
passes=$(http "satellites.fly.dev/passes/25544" lat=="-34.1234" lon=="-57.1234" | jq ".[] | select(.visible) | .start.timestamp")
for timestamp in $passes; do
echo "notify-send -u normal 'ISS arriba!'" | at "$(date_from_ts $timestamp)"
done
echo "$(realpath $0)" | at "$([ ! -z $timestamp ] && echo "$(date_from_ts $timestamp)" || echo "now + 1 day")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment