#!/bin/sh max=423 status=$TEMP/.status current() { if [ -f $status ]; then read num < $status if [ $num -gt $max ]; then num=1 fi next=$(($num + 1)) echo $next > $status echo $num else echo 2 > $status echo 1 fi } if [ -n "`which notify-send`" ]; then xdhamma -m $(current) exit 0 fi out=0 dhamma -m $(current) |\ while read line do len=$(expr length "$line") if [ $len -lt 2 ] && [ $out -gt 0 ]; then echo "" break fi echo -n "$line " out=$((out + 1)) done