You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
461 B
Bash

#!/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 "$@"