diff options
Diffstat (limited to 'i3blocks')
-rwxr-xr-x | i3blocks/i3date.sh | 16 | ||||
-rwxr-xr-x | i3blocks/i3disk.sh | 1 |
2 files changed, 16 insertions, 1 deletions
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 diff --git a/i3blocks/i3disk.sh b/i3blocks/i3disk.sh index a1aae81..158982f 100755 --- a/i3blocks/i3disk.sh +++ b/i3blocks/i3disk.sh @@ -9,3 +9,4 @@ $home" ;; esac df -h | grep "/home$" | awk '{print $3"/"$2}' +df -h | grep "/home$" | awk '{print $3}' |