fixed quotations error
This commit is contained in:
parent
110da95872
commit
b5eb0d339d
2 changed files with 8 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
default: bone
|
||||
default: nature
|
||||
|
||||
prompts:
|
||||
default: '\[\033[01;34m\]\u@\h \[\033[01;32m\]\w\[\033[00m\] \$ '
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue