Skip to content

Commit

Permalink
lib/appearance: export $CLICOLOR instead of $LSCOLOR
Browse files Browse the repository at this point in the history
Alsö, since the *value* of `$CLICOLOR` is not used anywhere, overload it to count the number of colors available for use elsewhere.
  • Loading branch information
gaelicWizard committed Mar 4, 2022
1 parent f7cba27 commit 0286a50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/appearance.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# shellcheck shell=bash

# colored ls
export LSCOLORS='Gxfxcxdxdxegedabagacad'
: "${CLICOLOR:=$(tput colors)}"
export CLICOLOR

: "${CUSTOM_THEME_DIR:="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/themes"}"

Expand Down
2 changes: 1 addition & 1 deletion lib/log.bash
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function _bash-it-log-prefix-by-path() {

function _has_colors() {
# Check that stdout is a terminal, and that it has at least 8 colors.
[[ -t 1 && "${_bash_it_available_colors:=$(tput colors 2> /dev/null)}" -ge 8 ]]
[[ -t 1 && "${CLICOLOR:=$(tput colors 2> /dev/null)}" -ge 8 ]]
}

function _bash-it-log-message() {
Expand Down
4 changes: 4 additions & 0 deletions themes/base.theme.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# shellcheck shell=bash
# shellcheck disable=SC2034 # Expected behavior for themes.

# Colors for listing files, using default color scheme.
# To customize color scheme by theme, check out https://geoff.greer.fm/lscolors/
export CLICOLOR LSCOLORS LS_COLORS

CLOCK_CHAR_THEME_PROMPT_PREFIX=''
CLOCK_CHAR_THEME_PROMPT_SUFFIX=''
CLOCK_THEME_PROMPT_PREFIX=''
Expand Down

0 comments on commit 0286a50

Please sign in to comment.