Merge pull request #1532 from BarbUk/update/barbuk_theme

Font usage for theme barbuk and git glyphs customization
pull/1539/head
Nils Winkler 2020-03-31 08:29:24 +02:00 committed by GitHub
commit 4ef9cff4f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 6 deletions

View File

@ -9,6 +9,34 @@ A minimal theme with a clean git prompt
* Current git info * Current git info
* Last command exit code (only shown when the exit code is greater than 0) * Last command exit code (only shown when the exit code is greater than 0)
## 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
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 ## Examples
### Clean ### Clean
@ -22,3 +50,4 @@ A minimal theme with a clean git prompt
```bash ```bash
 ~/.dotfiles on  master ⤏ origin ↑2 •7 ✗  ~/.dotfiles on  master ⤏ origin ↑2 •7 ✗
``` ```

View File

@ -1,11 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=2034,2154 # shellcheck disable=2034,2154
SCM_GIT_CHAR_GITLAB=' ' # Theme custom glyphs
SCM_GIT_CHAR_BITBUCKET=' ' SCM_GIT_CHAR_GITLAB=${SCM_GITLAB_CHAR:=' '}
SCM_GIT_CHAR_GITHUB=' ' SCM_GIT_CHAR_BITBUCKET=${SCM_GIT_CHAR_BITBUCKET:=' '}
SCM_GIT_CHAR_DEFAULT=' ' SCM_GIT_CHAR_GITHUB=${SCM_GIT_CHAR_GITHUB:=' '}
SCM_GIT_CHAR_ICON_BRANCH='' 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_HG_CHAR='☿ '
SCM_SVN_CHAR='⑆ ' SCM_SVN_CHAR='⑆ '
SCM_NONE_CHAR= SCM_NONE_CHAR=
@ -25,7 +29,6 @@ GIT_THEME_PROMPT_SUFFIX="${cyan}"
SCM_THEME_BRANCH_TRACK_PREFIX="${normal}${cyan}" SCM_THEME_BRANCH_TRACK_PREFIX="${normal}${cyan}"
SCM_THEME_CURRENT_USER_PREFFIX='  ' SCM_THEME_CURRENT_USER_PREFFIX='  '
SCM_GIT_SHOW_CURRENT_USER=false SCM_GIT_SHOW_CURRENT_USER=false
EXIT_CODE_ICON=' '
function _git-uptream-remote-logo { function _git-uptream-remote-logo {
[[ "$(_git-upstream)" == "" ]] && return [[ "$(_git-upstream)" == "" ]] && return