diff --git a/.travis.yml b/.travis.yml index 735dceeb..388082b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,4 +24,4 @@ script: # 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. # 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 diff --git a/neofetch b/neofetch index 920c4cca..d14e23f0 100755 --- a/neofetch +++ b/neofetch @@ -1978,8 +1978,18 @@ get_term_font() { case "$term" in "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}' \ - "${XDG_CONFIG_HOME}/alacritty/alacritty.yml")" + "$alacritty_file")" term_font="${term_font/*family:}" term_font="${term_font/$'\n'*}" term_font="${term_font/\#*}"