X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Femotty%2Femotty.plugin.zsh;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Femotty%2Femotty.plugin.zsh;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=661169a8b7b2f20305a8be32ab56094e168e3939;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/emotty/emotty.plugin.zsh b/stow/oh-my-zsh/.oh-my-zsh/plugins/emotty/emotty.plugin.zsh deleted file mode 100644 index 661169a..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/emotty/emotty.plugin.zsh +++ /dev/null @@ -1,55 +0,0 @@ -# ------------------------------------------------------------------------------ -# FILE: emotty.plugin.zsh -# DESCRIPTION: Return an emoji for the current $TTY number. -# AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) -# VERSION: 1.0.0 -# DEPENDS: emoji plugin -# -# There are different sets of emoji characters available, to choose a different -# set export emotty_set to the name of the set you would like to use, e.g.: -# % export emotty_set=nature -# ------------------------------------------------------------------------------ - -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" - -typeset -gAH _emotty_sets -local _emotty_plugin_dir="${0:h}" -source "$_emotty_plugin_dir/emotty_stellar_set.zsh" -source "$_emotty_plugin_dir/emotty_floral_set.zsh" -source "$_emotty_plugin_dir/emotty_zodiac_set.zsh" -source "$_emotty_plugin_dir/emotty_nature_set.zsh" -source "$_emotty_plugin_dir/emotty_emoji_set.zsh" -source "$_emotty_plugin_dir/emotty_love_set.zsh" -unset _emotty_plugin_dir - -emotty_default_set=emoji - -function emotty() { - # Use emotty set defined by user, fallback to default - local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]} - - # Parse tty number via prompt expansion. %l equals: - # - N if tty = /dev/ttyN - # - pts/N if tty = /dev/pts/N - local tty=${${(%):-%l}##pts/} - # Normalize it to an emotty set index - (( tty = (tty % ${#${=emotty}}) + 1 )) - - local character_name=${${=emotty}[tty]} - echo "${emoji[${character_name}]}${emoji2[emoji_style]}" -} - -function display_emotty() { - local name=${1:-$emotty_set} - echo $name - for i in ${=_emotty_sets[$name]}; do - printf "${emoji[$i]}${emoji2[emoji_style]} " - done - print - for i in ${=_emotty_sets[$name]}; do - print "${emoji[$i]}${emoji2[emoji_style]} = $i" - done -}