aboutsummaryrefslogtreecommitdiff
path: root/i3blocks
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-08-19 01:21:35 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-08-19 01:21:35 +0200
commit8cb589fa44926b341e71373ed8f815528cfb67cc (patch)
treeb971f477e0c734fcdd489edd5b7ba574a7a4ddc8 /i3blocks
parentb257bbcf7825c69fc3a6d00cf825e4c250f85031 (diff)
downloadscripts-8cb589fa44926b341e71373ed8f815528cfb67cc.tar.gz
scripts-8cb589fa44926b341e71373ed8f815528cfb67cc.zip
Fixing typos, cleaning webview, allowing comments in emoji file.
Diffstat (limited to 'i3blocks')
-rwxr-xr-xi3blocks/i3date.sh16
-rwxr-xr-xi3blocks/i3disk.sh1
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}'