diff --git a/config/colors.conf b/config/colors.conf index 90fd2e4..fffb4f2 100644 --- a/config/colors.conf +++ b/config/colors.conf @@ -3,11 +3,17 @@ # Color configuration for the segments. # See src/colors/*.bash for the color values +SEGMENTS_AWS_COLOR_PRIMARY=${SEGMENTS_AWS_COLOR_PRIMARY:-$color8} +SEGMENTS_AWS_COLOR_SECONDARY=${SEGMENTS_AWS_COLOR_SECONDARY:-$color9} + SEGMENTS_COMMAND_COLOR_PRIMARY=${SEGMENTS_COMMAND_COLOR_PRIMARY:-$color4} SEGMENTS_COMMAND_COLOR_SECONDARY=${SEGMENTS_COMMAND_COLOR_SECONDARY:-$color1} SEGMENTS_COMMAND_COLOR_PRIMARY_HIGHLIGHT=${SEGMENTS_COMMAND_COLOR_PRIMARY_HIGHLIGHT:-$color8} SEGMENTS_COMMAND_COLOR_SECONDARY_HIGHLIGHT=${SEGMENTS_COMMAND_COLOR_SECONDARY_HIGHLIGHT:-$color4} +SEGMENTS_CONDA_COLOR_PRIMARY=${SEGMENTS_CONDA_COLOR_PRIMARY:-$color8} +SEGMENTS_CONDA_COLOR_SECONDARY=${SEGMENTS_CONDA_COLOR_SECONDARY:-$color9} + SEGMENTS_GIT_COLOR_PRIMARY=${SEGMENTS_GIT_COLOR_PRIMARY:-$color10} SEGMENTS_GIT_COLOR_SECONDARY=${SEGMENTS_GIT_COLOR_SECONDARY:-$color1} @@ -16,6 +22,17 @@ SEGMENTS_HOST_COLOR_SECONDARY=${SEGMENTS_HOST_COLOR_SECONDARY:-$color5} SEGMENTS_HOST_COLOR_PRIMARY_HIGHLIGHT=${SEGMENTS_HOST_COLOR_PRIMARY_HIGHLIGHT:-$color9} SEGMENTS_HOST_COLOR_SECONDARY_HIGHLIGHT=${SEGMENTS_HOST_COLOR_SECONDARY_HIGHLIGHT:-$color0} +SEGMENTS_K8S_COLOR_PRIMARY=${SEGMENTS_K8S_COLOR_PRIMARY:-$color3} +SEGMENTS_K8S_COLOR_SECONDARY=${SEGMENTS_K8S_COLOR_SECONDARY:-$color7} + +SEGMENTS_LOAD_COLOR_PRIMARY=${SEGMENTS_LOAD_COLOR_PRIMARY:-$color9} +SEGMENTS_LOAD_COLOR_SECONDARY=${SEGMENTS_LOAD_COLOR_SECONDARY:-$color1} +SEGMENTS_LOAD_COLOR_PRIMARY_HIGHLIGHT=${SEGMENTS_LOAD_COLOR_PRIMARY_HIGHLIGHT:-$color8} +SEGMENTS_LOAD_COLOR_SECONDARY_HIGHLIGHT=${SEGMENTS_LOAD_COLOR_SECONDARY_HIGHLIGHT:-$color7} + +SEGMENTS_NIX_COLOR_PRIMARY=${SEGMENTS_NIX_COLOR_PRIMARY:-$color13} +SEGMENTS_NIX_COLOR_SECONDARY=${SEGMENTS_NIX_COLOR_SECONDARY:-$color7} + SEGMENTS_PATH_COLOR_PRIMARY=${SEGMENTS_PATH_COLOR_PRIMARY:-$color14} SEGMENTS_PATH_COLOR_SECONDARY=${SEGMENTS_PATH_COLOR_SECONDARY:-$color7} SEGMENTS_PATH_COLOR_SPLITTER=${SEGMENTS_PATH_COLOR_SPLITTER:-$color4} @@ -29,30 +46,16 @@ SEGMENTS_PROMPT_READY_COLOR_SECONDARY=${SEGMENTS_PROMPT_READY_COLOR_SECONDARY:-$ SEGMENTS_PYTHON_ENV_COLOR_PRIMARY=${SEGMENTS_PYTHON_ENV_COLOR_PRIMARY:-$color9} SEGMENTS_PYTHON_ENV_COLOR_SECONDARY=${SEGMENTS_PYTHON_ENV_COLOR_SECONDARY:-$color15} +SEGMENTS_RESCUETIME_COLOR_PRIMARY=${SEGMENTS_RESCUETIME_COLOR_PRIMARY:-$color11} +SEGMENTS_RESCUETIME_COLOR_SECONDARY=${SEGMENTS_RESCUETIME_COLOR_SECONDARY:-$color4} +SEGMENTS_RESCUETIME_COLOR_SPLITTER=${SEGMENTS_RESCUETIME_COLOR_SPLITTER:-$color7} + SEGMENTS_RETURN_CODE_COLOR_PRIMARY=${SEGMENTS_RETURN_CODE_COLOR_PRIMARY:-$color1} SEGMENTS_RETURN_CODE_COLOR_SECONDARY=${SEGMENTS_RETURN_CODE_COLOR_SECONDARY:-$color15} SEGMENTS_TIMESTAMP_COLOR_PRIMARY=${SEGMENTS_TIMESTAMP_COLOR_PRIMARY:-$color2} SEGMENTS_TIMESTAMP_COLOR_SECONDARY=${SEGMENTS_TIMESTAMP_COLOR_SECONDARY:-$color5} -SEGMENTS_CONDA_COLOR_PRIMARY=${SEGMENTS_CONDA_COLOR_PRIMARY:-$color8} -SEGMENTS_CONDA_COLOR_SECONDARY=${SEGMENTS_CONDA_COLOR_SECONDARY:-$color9} - -SEGMENTS_AWS_COLOR_PRIMARY=${SEGMENTS_AWS_COLOR_PRIMARY:-$color8} -SEGMENTS_AWS_COLOR_SECONDARY=${SEGMENTS_AWS_COLOR_SECONDARY:-$color9} - -SEGMENTS_K8S_COLOR_PRIMARY=${SEGMENTS_K8S_COLOR_PRIMARY:-$color3} -SEGMENTS_K8S_COLOR_SECONDARY=${SEGMENTS_K8S_COLOR_SECONDARY:-$color7} - -SEGMENTS_LOAD_COLOR_PRIMARY=${SEGMENTS_LOAD_COLOR_PRIMARY:-$color9} -SEGMENTS_LOAD_COLOR_SECONDARY=${SEGMENTS_LOAD_COLOR_SECONDARY:-$color1} -SEGMENTS_LOAD_COLOR_PRIMARY_HIGHLIGHT=${SEGMENTS_LOAD_COLOR_PRIMARY_HIGHLIGHT:-$color8} -SEGMENTS_LOAD_COLOR_SECONDARY_HIGHLIGHT=${SEGMENTS_LOAD_COLOR_SECONDARY_HIGHLIGHT:-$color7} - -SEGMENTS_RESCUETIME_COLOR_PRIMARY=${SEGMENTS_RESCUETIME_COLOR_PRIMARY:-$color11} -SEGMENTS_RESCUETIME_COLOR_SECONDARY=${SEGMENTS_RESCUETIME_COLOR_SECONDARY:-$color4} -SEGMENTS_RESCUETIME_COLOR_SPLITTER=${SEGMENTS_RESCUETIME_COLOR_SPLITTER:-$color7} - SEGMENTS_WTTR_COLOR_PRIMARY=${SEGMENTS_WTTR_COLOR_PRIMARY:-$color11} SEGMENTS_WTTR_COLOR_SECONDARY=${SEGMENTS_WTTR_COLOR_SECONDARY:-$color4} SEGMENTS_WTTR_COLOR_SPLITTER=${SEGMENTS_WTTR_COLOR_SPLITTER:-$color7} diff --git a/config/settings.conf.template b/config/settings.conf.template index 4feab36..3fab82d 100644 --- a/config/settings.conf.template +++ b/config/settings.conf.template @@ -17,7 +17,7 @@ if [[ "$COLUMNS" -le 120 ]]; then SBP_THEME_LAYOUT='lines' SBP_SEGMENTS_LEFT=('path' 'python_env' 'git' 'command') else - SBP_SEGMENTS_LEFT=('host' 'path' 'python_env' 'k8s' 'git') + SBP_SEGMENTS_LEFT=('host' 'path' 'python_env' 'k8s' 'git' 'nix') SBP_SEGMENTS_RIGHT=('command' 'timestamp') SBP_SEGMENTS_LINE_TWO=('prompt_ready') fi diff --git a/src/segments/README.md b/src/segments/README.md index 190228d..601710f 100644 --- a/src/segments/README.md +++ b/src/segments/README.md @@ -60,6 +60,9 @@ truncation/compacting for that specific segment. ## load shows the average load of the machine +## nix + shows wether you are in a nix-shell or not + ## path shows the current path @@ -85,4 +88,3 @@ truncation/compacting for that specific segment. Shows the weather based on ´SEGMENTS_WTTR_LOCATION´ and ´SEGMENTS_WTTR_FORMAT´, the default values are ´Oslo´ and ´%p;%t;%w´ respectively. - diff --git a/src/segments/nix.bash b/src/segments/nix.bash new file mode 100644 index 0000000..10472c6 --- /dev/null +++ b/src/segments/nix.bash @@ -0,0 +1,7 @@ +#! /usr/bin/env bash + +segments::nix() { + if [[ -n "$IN_NIX_SHELL" ]]; then + print_themed_segment 'normal' "nix-shell" + fi +}