oh-my-fish/plugins/emoji-clock/emoji-clock.fish

90 lines
1.9 KiB
Fish
Raw Normal View History

2013-06-23 19:15:08 +08:00
# ------------------------------------------------------------------------------
# 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) ported to fish by Erik Kallen
# VERSION: 1.0.0
# -----------------------------------------------------------------------------
function emoji-clock
set hour (date '+%I')
set minutes (date '+%M')
switch $hour
case 01
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕜"
else
set clock "🕐"
end
2013-06-23 19:15:08 +08:00
case 02
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕝"
else
set clock "🕑"
end
2013-06-23 19:15:08 +08:00
case 03
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕞"
else
set clock "🕒"
end
2013-06-23 19:15:08 +08:00
case 04
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕟"
else
set clock "🕓"
end
2013-06-23 19:15:08 +08:00
case 05
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕠"
else
set clock "🕔"
end
2013-06-23 19:15:08 +08:00
case 06
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕡"
else
set clock "🕕"
end
2013-06-23 19:15:08 +08:00
case 07
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕢"
else
set clock "🕖"
end
2013-06-23 19:15:08 +08:00
case 08
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕣"
else
set clock "🕗"
end
2013-06-23 19:15:08 +08:00
case 09
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕤"
else
set clock "🕘"
end
2013-06-23 19:15:08 +08:00
case 10
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕥"
else
set clock "🕙"
end
2013-06-23 19:15:08 +08:00
case 11
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕦"
else
set clock "🕚"
end
2013-06-23 19:15:08 +08:00
case 12
2013-11-20 17:53:39 +08:00
if test $minutes -ge 30
set clock "🕧"
else
set clock "🕛"
end
2013-06-23 19:15:08 +08:00
case '*' set clock "⌛"
end
echo $clock
end