namaadhu-vaguthu/namaadhuvaguthu.sh

55 lines
716 B
Bash
Executable File

#!/bin/bash
INPUT=prayer.png
OUTPUT=prayer_added.png
DATE=$1
ISLAND=$2
rm $OUTPUT > /dev/null
imagemagick(){
TIME=$1
PRAYER=$2
case $PRAYER in
fathis)
POSITION='+685+430'
;;
iruaraa)
POSITION='+440+430'
;;
mendhuru)
POSITION='+220+430'
;;
asr)
POSITION='+685+768'
;;
magrib)
POSITION='+440+768'
;;
isha)
POSITION='+220+768'
esac
if [ -f $OUTPUT ]
then
INPUT=$OUTPUT
fi
echo Island=$ISLAND Prayer=$PRAYER Date=$DATE File=$OUTPUT
convert $INPUT \
-font $PWD/CourierPrime.ttf \
-pointsize 48 \
-fill white \
-annotate $POSITION $TIME \
$OUTPUT
}
imagemagick $DATE fathis
imagemagick $DATE iruaraa
imagemagick $DATE mendhuru
imagemagick $DATE asr
imagemagick $DATE magrib
imagemagick $DATE isha
feh $OUTPUT