3 ms·
I'm not sure it would be 1000x the work. Just need a command line tool to parse ics which I can point at my nextcloud calendar, and then wrap it in another bash
by mike-cardwell 8y ago
I'm not sure it would be 1000x the work. Just need a command line tool to parse ics which I can point at my nextcloud calendar, and then wrap it in another bash script called "atworktoday" or something, so I can do something like:
50 7 * * 1-5 atworktoday && blanket on for 5 minutes
Would be nice if there was a tool which would allow me to do something like:
curl -s https://link-to-my-ics | \
ics --start $(date +%Y%m%dT000000Z) \
--end $(date +%Y%m%dT235959Z) \
--filter-summary 'annual leave'
There must be loads of use cases for a tool which allows you to parse and filter ics. Even a tool which just converts ics to json would be pretty useful as we could then filter results with the excellent "jq" application:
ANNUAL_LEAVE=$(curl -s https://link-to-my-ics \
| ics2json --start $(date +%Y%m%dT000000Z) \
--end $(date +%Y%m%dT235959Z) \
| jq 'map(select(.summary|ascii_downcase|contains("annual leave")))|length')
if [[ "$ANNUAL_LEAVE" == "0" ]]; then
echo "At work today"
else
echo "On holiday, wahoo!"
fi
Somebody write this ;)
- snaky 8y agoI was talking about coupling it with the smart alarm - that requires getting the realtime data from the smartwatch.
- mike-cardwell 8y agoOh right, yeah. I don't use the Pebble Smart Alarm. I tried to, but I don't believe it's any smarter than just picking a random time in a specified period. I mean, I know it claims to work based on when you're coming out of a deep sleep, but I saw no evidence that it actually did work that way when using it.