Last active
September 7, 2016 16:41
-
-
Save nickrw/4f7fb996010d0f3e111c to your computer and use it in GitHub Desktop.
nextcal.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Fetches the next item in your google calendar (assuming pre-set-up by running gcalcli) | |
CALENDAR_NAME="" | |
cal="$(gcalcli \ | |
--nostarted \ | |
--calendar $CALENDAR_NAME \ | |
--nocolor \ | |
--military \ | |
agenda 00:00 23:59 \ | |
| sed -E '/^$/d; s/ +/ /g; s/^(([^ ]+ ){3}| +)//; s/ / - /' \ | |
| head -n1)" | |
if [ -z "$cal" ]; then | |
cal="Nothing" | |
fi | |
echo "Next: $cal" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment