From 0d3c40af49fab424fe00002d5ee24a1287e11920 Mon Sep 17 00:00:00 2001 From: blyndusk Date: Sun, 19 May 2019 22:12:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++++---------- sm.zsh-theme | 10 +++++----- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7e21064..927fc29 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # sm-theme - +sm-theme last release sm-theme top language - + ![sm-theme](./docs/sm-theme.png) @@ -38,34 +38,38 @@ #### Without smileys ```bash -13 local with_smileys=0; +13 local SM_WITH_SMILEYS=0; ``` -![with-smileys](./docs/without-smileys.png) +![without-smileys-clean](./docs/without-smileys-clean.png) +![without-smileys-dirty](./docs/without-smileys-dirty.png) #### With smileys ```bash -13 local with_smileys=1; +13 local SM_WITH_SMILEYS=1; ``` -![with-smileys](./docs/default.png) +![with-smileys-clean](./docs/with-smileys-clean.png) +![with-smileys-clean](./docs/with-smileys-dirty.png) ### 2. Lines #### With two lines ```bash -16 local prompt_lines=2; +16 local SM_PROMPT_LINES=2; ``` -![with-smileys](./docs/2-lines.png) + +![2 lines](./docs/2-lines.png) #### With three lines ```bash -16 local prompt_lines=3; +16 local SM_PROMPT_LINES=3; ``` -![with-smileys](./docs/default.png) + +![3 lines](./docs/with-smileys-dirty.png) ## Curated List diff --git a/sm.zsh-theme b/sm.zsh-theme index a490ee2..6ea03e3 100644 --- a/sm.zsh-theme +++ b/sm.zsh-theme @@ -10,10 +10,10 @@ echo -e "\e[31m # config # 1: with smileys ; 0: without smileys -local with_smileys=1; +local SM_WITH_SMILEYS=1; # 2: with 2 lines ; else: default -local prompt_lines=3 +local SM_PROMPT_LINES=3; # write # $(pictos_or_smileys 1 <0/1>) to use emojis @@ -21,8 +21,8 @@ local prompt_lines=3 pictos_or_smileys () { local emojis; local emojis=(" ✘" "[ಠ_ಠ]" " ✔︎" "[・‿・]"); - if [ "$1" -eq 0 ] ; then echo "%F{red}${emojis[1 + $with_smileys]}%F{default}" ; - elif [ "$1" -eq 1 ] ; then echo "%F{green}${emojis[3 + $with_smileys]}%F{default}" ; fi + if [ "$1" -eq 0 ] ; then echo "%F{red}${emojis[1 + $SM_WITH_SMILEYS]}%F{default}" ; + elif [ "$1" -eq 1 ] ; then echo "%F{green}${emojis[3 + $SM_WITH_SMILEYS]}%F{default}" ; fi } # display red user if sudo is enabeled @@ -32,7 +32,7 @@ sudo_color() { } sm_prompt() { - if [ $prompt_lines -eq 2 ] ; then + if [ $SM_PROMPT_LINES -eq 2 ] ; then echo '$SM_PREFIX $SM_USER $SM_DIR $(git_prompt_info) $(git_prompt_status) $SM_SUFFIX' else echo '$SM_PREFIX $SM_USER $(git_prompt_info) $(git_prompt_status)