From 5654874aee78d20aea796af9a235c72c81fd3172 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Mon, 30 Mar 2020 01:36:58 +0400 Subject: [PATCH 1/3] Documentation: font usage for theme barbuk --- themes/barbuk/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/barbuk/README.md b/themes/barbuk/README.md index 614940b4..d24ced21 100644 --- a/themes/barbuk/README.md +++ b/themes/barbuk/README.md @@ -9,6 +9,12 @@ A minimal theme with a clean git prompt * Current git info * Last command exit code (only shown when the exit code is greater than 0) +## Font + +A font with SCM glyph is required to display git remote tool logo. +You can use a font from https://www.nerdfonts.com/ or patch your own font with the tool +provided by https://github.com/ryanoasis/nerd-fonts + ## Examples ### Clean From 611d4f234f455294bfe4b6c540ad3aca4825060d Mon Sep 17 00:00:00 2001 From: BarbUk Date: Mon, 30 Mar 2020 02:11:30 +0400 Subject: [PATCH 2/3] Update font documentation --- themes/barbuk/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/barbuk/README.md b/themes/barbuk/README.md index d24ced21..de218b30 100644 --- a/themes/barbuk/README.md +++ b/themes/barbuk/README.md @@ -11,9 +11,11 @@ A minimal theme with a clean git prompt ## Font -A font with SCM glyph is required to display git remote tool logo. +A font with SCM glyphs is required to display the default tool/host logos. You can use a font from https://www.nerdfonts.com/ or patch your own font with the tool -provided by https://github.com/ryanoasis/nerd-fonts +provided by https://github.com/ryanoasis/nerd-fonts. + +You can also override the default variables if you want to use different glyphs or standard ASCII characters. ## Examples From f4cc8ddb77d21f968bbc60cdab62a6ddb8c5b2ed Mon Sep 17 00:00:00 2001 From: BarbUk Date: Mon, 30 Mar 2020 14:23:58 +0400 Subject: [PATCH 3/3] Allow git glyphs customization --- themes/barbuk/README.md | 23 ++++++++++++++++++++++- themes/barbuk/barbuk.theme.bash | 15 +++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/themes/barbuk/README.md b/themes/barbuk/README.md index de218b30..cc188190 100644 --- a/themes/barbuk/README.md +++ b/themes/barbuk/README.md @@ -9,7 +9,7 @@ A minimal theme with a clean git prompt * Current git info * Last command exit code (only shown when the exit code is greater than 0) -## Font +## Fonts and glyphs A font with SCM glyphs is required to display the default tool/host logos. You can use a font from https://www.nerdfonts.com/ or patch your own font with the tool @@ -17,6 +17,26 @@ provided by https://github.com/ryanoasis/nerd-fonts. You can also override the default variables if you want to use different glyphs or standard ASCII characters. +### Default theme glyphs + +```bash +SCM_GIT_CHAR_GITLAB=' ' +SCM_GIT_CHAR_BITBUCKET=' ' +SCM_GIT_CHAR_GITHUB=' ' +SCM_GIT_CHAR_DEFAULT=' ' +SCM_GIT_CHAR_ICON_BRANCH='' +EXIT_CODE_ICON=' ' +``` + +### Customize glyphs + +Define your custom glyphs before sourcing bash-it: + +```bash +SCM_GIT_CHAR_GITHUB='•' +source "$BASH_IT"/bash_it.sh +``` + ## Examples ### Clean @@ -30,3 +50,4 @@ You can also override the default variables if you want to use different glyphs ```bash  ~/.dotfiles on  master ⤏ origin ↑2 •7 ✗ ❯ ``` + diff --git a/themes/barbuk/barbuk.theme.bash b/themes/barbuk/barbuk.theme.bash index 971cdd91..39d4995e 100644 --- a/themes/barbuk/barbuk.theme.bash +++ b/themes/barbuk/barbuk.theme.bash @@ -1,11 +1,15 @@ #!/usr/bin/env bash # shellcheck disable=2034,2154 -SCM_GIT_CHAR_GITLAB=' ' -SCM_GIT_CHAR_BITBUCKET=' ' -SCM_GIT_CHAR_GITHUB=' ' -SCM_GIT_CHAR_DEFAULT=' ' -SCM_GIT_CHAR_ICON_BRANCH='' +# Theme custom glyphs +SCM_GIT_CHAR_GITLAB=${SCM_GITLAB_CHAR:=' '} +SCM_GIT_CHAR_BITBUCKET=${SCM_GIT_CHAR_BITBUCKET:=' '} +SCM_GIT_CHAR_GITHUB=${SCM_GIT_CHAR_GITHUB:=' '} +SCM_GIT_CHAR_DEFAULT=${SCM_GIT_CHAR_DEFAULT:=' '} +SCM_GIT_CHAR_ICON_BRANCH=${SCM_GIT_CHAR_ICON_BRANCH:=''} +EXIT_CODE_ICON=${EXIT_CODE_ICON:=' '} + +# Bash-it default glyphs customization SCM_HG_CHAR='☿ ' SCM_SVN_CHAR='⑆ ' SCM_NONE_CHAR= @@ -25,7 +29,6 @@ GIT_THEME_PROMPT_SUFFIX="${cyan}" SCM_THEME_BRANCH_TRACK_PREFIX="${normal} ⤏ ${cyan}" SCM_THEME_CURRENT_USER_PREFFIX='  ' SCM_GIT_SHOW_CURRENT_USER=false -EXIT_CODE_ICON=' ' function _git-uptream-remote-logo { [[ "$(_git-upstream)" == "" ]] && return