From 8cb589fa44926b341e71373ed8f815528cfb67cc Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Wed, 19 Aug 2020 01:21:35 +0200 Subject: Fixing typos, cleaning webview, allowing comments in emoji file. --- i3blocks/i3date.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'i3blocks/i3date.sh') diff --git a/i3blocks/i3date.sh b/i3blocks/i3date.sh index a54a135..0461323 100755 --- a/i3blocks/i3date.sh +++ b/i3blocks/i3date.sh @@ -9,4 +9,18 @@ esac #dayofyear=$(date +%j) #perc=$(echo "scale=1; ($dayofyear*100)/365" | bc) #echo $(date +"%A, %y/%m/%d ($perc%) - %T") -echo $(date +"%y/%m/%d %H:%M") + +day="$(date +"%y/%m/%d")" +hour="$(date +"%H:%M")" + +min=${hour#*:} +baseHour=${hour/:*} +[ $baseHour -gt 11 ] && baseHour=$((baseHour-12)) + +clocks=(🕛 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕧 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦) +clockIndex=$baseHour +[ $min -gt 29 ] && clockIndex=$((clockIndex+12)) +clock="${clocks[clockIndex]}" + +echo $clock $day $hour +echo $clock $hour -- cgit v1.2.1