disable theming by checking theme var for value

pull/1262/head
daniel.schroeder 2018-11-02 10:47:55 +01:00
parent fbefcb860b
commit b03a93cd2b
No known key found for this signature in database
GPG Key ID: 4B6D5ADC06C85E5F
3 changed files with 29 additions and 21 deletions

View File

@ -189,6 +189,7 @@ There are over 50+ Bash-it themes to pick from in `$BASH_IT/themes`.
The default theme is `bobby`. The default theme is `bobby`.
Set `BASH_IT_THEME` to the theme name you want, or if you've developed your own custom theme outside of `$BASH_IT/themes`, Set `BASH_IT_THEME` to the theme name you want, or if you've developed your own custom theme outside of `$BASH_IT/themes`,
point the `BASH_IT_THEME` variable directly to the theme file. point the `BASH_IT_THEME` variable directly to the theme file.
To disable theming completely, leave the variable empty.
Examples: Examples:
@ -198,6 +199,9 @@ export BASH_IT_THEME="powerline-multiline"
# Use a theme outside of the Bash-it folder # Use a theme outside of the Bash-it folder
export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash" export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash"
# Disable theming
export BASH_IT_THEME=""
``` ```
You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`. You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`.

View File

@ -46,6 +46,8 @@ do
_load_bash_it_files $file_type _load_bash_it_files $file_type
done done
# Load theme, if a theme was set
if [[ ! -z "${BASH_IT_THEME}" ]]; then
# Load colors and helpers first so they can be used in base theme # Load colors and helpers first so they can be used in base theme
# shellcheck source=./themes/colors.theme.bash # shellcheck source=./themes/colors.theme.bash
source "${BASH_IT}/themes/colors.theme.bash" source "${BASH_IT}/themes/colors.theme.bash"
@ -59,6 +61,7 @@ source "${BASH_IT}/themes/base.theme.bash"
# appearance (themes) now, after all dependencies # appearance (themes) now, after all dependencies
# shellcheck source=./lib/appearance.bash # shellcheck source=./lib/appearance.bash
source "$APPEARANCE_LIB" source "$APPEARANCE_LIB"
fi
# Load custom aliases, completion, plugins # Load custom aliases, completion, plugins
for file_type in "aliases" "completion" "plugins" for file_type in "aliases" "completion" "plugins"

View File

@ -3,7 +3,8 @@
# Path to the bash it configuration # Path to the bash it configuration
export BASH_IT="{{BASH_IT}}" export BASH_IT="{{BASH_IT}}"
# Lock and Load a custom theme file # Lock and Load a custom theme file.
# Leave empty to disable theming.
# location /.bash_it/themes/ # location /.bash_it/themes/
export BASH_IT_THEME='bobby' export BASH_IT_THEME='bobby'