#!/bin/bash
set -euo pipefail

# Sends a sample notification so the classroom styling can be checked
# without waiting for a real event.
#
#   classroom-notify-test
#   classroom-notify-test "Title" "Body text"
#   classroom-notify-test --critical "Parent Call" "Room 3 needs a parent."

urgency=normal

if [[ "${1:-}" == "--critical" ]]; then
    urgency=critical
    shift
elif [[ "${1:-}" == "--low" ]]; then
    urgency=low
    shift
fi

title="${1:-DVD Ready}"
body="${2:-A disc is ready to play.}"

notify-send \
    --app-name="Ekklesia Classroom" \
    --urgency="$urgency" \
    -- \
    "$title" "$body"

echo "Sent $urgency notification: $title"
