From bbbc7aca045a0c92205fdf41027ecd67afdc81b3 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 17 May 2016 06:54:57 +1000 Subject: [PATCH] Do a case insensitive grep instead of duplicating awk commands --- neofetch | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index c7ef1daf..238b2cb4 100755 --- a/neofetch +++ b/neofetch @@ -1760,12 +1760,9 @@ gettermfont () { [ -z "$term" ] && getterm case "$term" in - "urxvt"* | "xterm") - # Check for a different font line if the term is urxvt or xterm. - case "$term" in - "urxvt"*) termfont="$(awk -F ': ' '!/^($|!)/ && /t\*font/ {printf $2}' "$HOME/.Xresources")" ;; - "xterm") termfont="$(awk -F ': ' '!/^($|!)/ && /m\*font/ {printf $2}' "$HOME/.Xresources")" ;; - esac + "urxvt" | "urxvtd" | "xterm") + termfont="$(grep -i "${term/d}\*font" "$HOME/.Xresources")" + termfont=${termfont/*font: } # Xresources has two different font syntax, this checks which # one is in use and formats it accordingly.