You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
494 B

  1. #!/bin/bash
  2. function time_minus_minutes() {
  3. time="$1"
  4. change="$2"
  5. difference=$(($change * 60))
  6. result=$(( $(date -d "$time" "+%s") - $difference ))
  7. echo `date -d "@$result" "+%H:%M"`
  8. }
  9. TYPE=$1
  10. shift
  11. TARGET=$1
  12. shift
  13. SLACK=5
  14. TIME=`time_minus_minutes "$TARGET" "$SLACK"`
  15. NAME="$@"
  16. MSG="Meeting in $SLACK minutes. ... Meeting '$NAME' in $SLACK minutes."
  17. #echo "Scheduling $TYPE for meeting '$NAME' at $TARGET in $SLACK minutes in advance, at $TIME."
  18. ~/schedule_${TYPE} "$TIME" "$MSG"