#!/usr/bin/bash 


# Returns a clock emoji to the nearest half hour
hour=$(date +%l)
minute=$(date +%M)
CE=🕛
clock_array=(🕛 🕧 🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦)

hour=${hour#0}
minute=${minute#0}

if [[ $hour -eq 12 ]]; then
    hour=0
fi

index=$((hour * 2));
if [[ $minute -gt 29 ]]; then
    ((index++))
fi

CE=${clock_array[$index]}

echo $CE