#!/bin/bash
if [[ $# -lt 2 ]]; then
    echo "Usage: breathing [Delay] [Minutes]"
    exit 1
fi

xset dpms force off
DELAY=$1
TIMES=$(( ($2*60)/($DELAY*2) ))
for i in $(seq $TIMES)
do
    { aplay ~/Dokumente/inhale.wav & } >/dev/null 2>&1 
    sleep $DELAY
    { aplay ~/Dokumente/exhale.wav & } >/dev/null 2>&1 
    sleep $DELAY
done