1234567891011121314151617181920212223242526272829 |
- # ------------------------------------------------------------------------------
- # 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
- }
|