rwxrob-dot/scripts/cronoji
Rob Muhlestein 2ea0289e9f Rebase
2022-02-09 02:29:05 -05:00

26 lines
461 B
Bash
Executable File

#!/usr/bin/bash
readonly -a clocks=(
🕛 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚
🕧 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦
)
cronji() {
local time hour min dex
time=$(date +%-l\ %-M)
hour=${time% *}
min=${time#* }
(( hour == 12 )) && hour=0
if (( min >= 45 )); then
((hour+=1))
fi
if ((min>=15 && min<45)); then
dex=$((hour+12))
else
dex=$hour
fi
echo "${clocks[$dex]}"
}
cronji "$@"