From 56821a30e49f0f7230f784ac734579e64ecd67cc Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 11 Feb 2018 08:51:58 +1100 Subject: [PATCH] term_font: Add more paths for Alacritty. Closes #911 --- .travis.yml | 2 +- neofetch | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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/\#*}"