1
0
Fork 0

Add emoji-clock plugin

which displays the current time with half hour accuracy as an emoji
symbol, for example in the shell prompt.
This commit is contained in:
Alexis Hildebrandt 2013-04-08 09:38:15 +02:00
parent 989b6ec29e
commit 9af2295394

View file

@ -0,0 +1,29 @@
# ------------------------------------------------------------------------------
# FILE: emoji-clock.plugin.zsh
# DESCRIPTION: The current time with half hour accuracy as an emoji symbol.
# Inspired by Andre Torrez' "Put A Burger In Your Shell"
# http://notes.torrez.org/2013/04/put-a-burger-in-your-shell.html
# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net)
# VERSION: 1.0.0
# -----------------------------------------------------------------------------
function emoji-clock() {
hour=$(date '+%I')
minutes=$(date '+%M')
case $hour in
01) clock="πŸ•"; [ $minutes -ge 30 ] && clock="πŸ•œ";;
02) clock="πŸ•‘"; [ $minutes -ge 30 ] && clock="πŸ•";;
03) clock="πŸ•’"; [ $minutes -ge 30 ] && clock="πŸ•ž";;
04) clock="πŸ•“"; [ $minutes -ge 30 ] && clock="πŸ•Ÿ";;
05) clock="πŸ•”"; [ $minutes -ge 30 ] && clock="πŸ• ";;
06) clock="πŸ••"; [ $minutes -ge 30 ] && clock="πŸ•‘";;
07) clock="πŸ•–"; [ $minutes -ge 30 ] && clock="πŸ•’";;
08) clock="πŸ•—"; [ $minutes -ge 30 ] && clock="πŸ•£";;
09) clock="πŸ•˜"; [ $minutes -ge 30 ] && clock="πŸ•€";;
10) clock="πŸ•™"; [ $minutes -ge 30 ] && clock="πŸ•₯";;
11) clock="πŸ•š"; [ $minutes -ge 30 ] && clock="πŸ•¦";;
12) clock="πŸ•›"; [ $minutes -ge 30 ] && clock="πŸ•§";;
*) clock="βŒ›";;
esac
echo $clock
}