less error outpouts if no appointment
This commit is contained in:
parent
66d3669b51
commit
7aa8c71d49
@ -2,6 +2,7 @@
|
||||
#Print the next appointment for the day for statusbar
|
||||
#or generate notification for upcoming appointment
|
||||
diff=$(calcurse --next | tail -n1 | sed 's/^\s*//; s/\[//;s/\]//' | cut -f1 -d ' ')
|
||||
if [ -n "$diff" ]; then
|
||||
secs=$(( $(echo "$diff" | cut -f1 -d ':') * 3600 + $(echo "$diff" | cut -f2 -d ':') *60 ))
|
||||
time_appointment="$(date --date "@$(( $( date +'%s' ) + $secs ))" +"%s")"
|
||||
appointment="$(calcurse --next | tail -n1 | awk '{$1=""; print $0}' | sed 's/^\s*//')"
|
||||
@ -13,5 +14,7 @@ else
|
||||
if [ $midnight -gt "$time_appointment" ]; then
|
||||
printf '%s %s' "$(date --date "@$time_appointment" +'%H:%M')" "$appointment"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
printf '\n'
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user