dotfiles/bin/calcurse-sync.sh

17 lines
428 B
Bash
Executable File

#!/bin/bash
OUTPUT=$(CALCURSE_CALDAV_PASSWORD=$(pass show cal.keegandeppe.com/kdeppe 2>&1) calcurse-caldav 2>&1)
ERRORS=$(echo "$OUTPUT" | grep error)
if [ -n "$ERRORS" ] ; then
polybar-msg action calendar-sync hook 2 1>/dev/null
exit 0
fi
# success, show green for a few seconds and quit
polybar-msg action calendar-sync hook 1 1>/dev/null
sleep 3
polybar-msg action calendar-sync hook 0 1>/dev/null
exit 0