#!/bin/bash
counter=0
limit=$1
summary="Timer"
startmessage="start"
endmessage="abgelaufen"

notify-send -u critical -i appointment -t 2000 "$summary" "$startmessage"
echo
while [ $counter != $limit ]; do
   sleep 60
   let "counter = $counter + 1"
   let "rest = $limit - $counter"
	notify-send -u critical -i appointment -t 1000 "$summary" "Restzeit $rest"
   echo "Restzeit: $rest.";
done
if [ $counter = $limit ]; then
   echo
   notify-send -u critical -i appointment -t 10000 "$summary" "$endmessage"
   echo -e '\a' >&2
   exit 0
fi

