diff --git a/bin/prompt-theme.sh b/bin/prompt-theme.sh index 36eaa4d..8a909bc 100755 --- a/bin/prompt-theme.sh +++ b/bin/prompt-theme.sh @@ -1,7 +1,7 @@ #!/bin/bash #config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -config_dir="$HOME/.config/prompt-theme/" +config_dir="$HOME/.config/prompt-theme" config_file="$config_dir/config.yaml" shell_colors="$config_dir/dircolors" @@ -19,7 +19,7 @@ fi # If no theme given, attempt to get it from config if [[ -z "$theme" && -f "$config_file" ]]; then - theme=$(yq '.default' "$config_file") + theme=$(yq -r '.default' "$config_file") fi # Fail silently if no theme could be determined @@ -46,6 +46,10 @@ else fi fi +echo "shell_colors: $shell_colors" +echo "theme: $theme" +echo "dir_colors_cmd: $dircolors_cmd" + # Apply dircolors theme or fallback if [[ -r "$shell_colors/$theme" ]]; then eval "$($dircolors_cmd -b "$shell_colors/$theme")" @@ -57,7 +61,7 @@ fi # get prompt from config.yaml if available if [[ -f "$config_file" ]]; then - prompt=$(yq ".prompts.$theme" "$config_file") + prompt=$(yq -r ".prompts.$theme" "$config_file") else prompt="" fi diff --git a/config.yaml b/config.yaml index 6e2ec2a..189edca 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -default: bone +default: nature prompts: default: '\[\033[01;34m\]\u@\h \[\033[01;32m\]\w\[\033[00m\] \$ '