term_font: Add more paths for Alacritty. Closes #911

This commit is contained in:
Dylan Araps 2018-02-11 08:51:58 +11:00
parent 023e3ee891
commit 56821a30e4
2 changed files with 12 additions and 2 deletions

View File

@ -24,4 +24,4 @@ script:
# The if statement is here to invert the exit code from grep. # The if statement is here to invert the exit code from grep.
# grep normally errors if no match is found but we want the opposite. # grep normally errors if no match is found but we want the opposite.
# We invert it so grep fails if a match is found. # We invert it so grep fails if a match is found.
# - if grep '.\{101\}' neofetch; then (exit 1); else (exit 0); fi - if grep '.\{101\}' neofetch; then (exit 1); else (exit 0); fi

View File

@ -1978,8 +1978,18 @@ get_term_font() {
case "$term" in case "$term" in
"alacritty"*) "alacritty"*)
if [[ -f "${XDG_CONFIG_HOME}/alacritty.yml" ]]; then
alacritty_file="${XDG_CONFIG_HOME}/alacritty.yml"
elif [[ -f "${XDG_CONFIG_HOME}/alacritty/alacritty.yml" ]]; then
alacritty_file="${XDG_CONFIG_HOME}/alacritty/alacritty.yml"
elif [[ -f "${HOME}/.alacritty.yml" ]]; then
alacritty_file="${HOME}/.alacritty.yml"
fi
term_font="$(awk -F ':|#' '/normal:/ {getline; print}' \ term_font="$(awk -F ':|#' '/normal:/ {getline; print}' \
"${XDG_CONFIG_HOME}/alacritty/alacritty.yml")" "$alacritty_file")"
term_font="${term_font/*family:}" term_font="${term_font/*family:}"
term_font="${term_font/$'\n'*}" term_font="${term_font/$'\n'*}"
term_font="${term_font/\#*}" term_font="${term_font/\#*}"