Permalink
Browse files

Add emoji-clock plugin

which displays the current time with half hour accuracy as an emoji
symbol, for example in the shell prompt.
  • Loading branch information...
1 parent 989b6ec commit 9af229539467adf010c1f81c0ac4f03dc9bc9542 @afh afh committed Apr 8, 2013
Showing with 29 additions and 0 deletions.
  1. +29 โˆ’0 plugins/emoji-clock/emoji-clock.plugin.zsh
@@ -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
+}

0 comments on commit 9af2295

Please sign in to comment.