From f5a9393d4bacb2767e810dfd812bbac24567e2b0 Mon Sep 17 00:00:00 2001 From: Vincent Aranega Date: Thu, 16 Jun 2016 15:39:30 +0200 Subject: [PATCH] Enhanced font detection for terminology As 'grep -B' is a GNU extension, a more portable solution is preferable. The most direct and simple solution would be using 'awk': awk '/^font.name$/{print a}{a=$0}' But a sed solution could also be applied: sed -n '/^font\.name$/{g;1!p;};h' --- neofetch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 84eb1970..83207c5c 100755 --- a/neofetch +++ b/neofetch @@ -1816,7 +1816,7 @@ gettermfont () { ;; "terminology") - termfont="$(strings ${XDG_CONFIG_HOME}/terminology/config/standard/base.cfg | grep -B1 font.name | head -1)" + termfont="$(strings ${XDG_CONFIG_HOME}/terminology/config/standard/base.cfg | awk '/^font.name$/{print a}{a=$0}')" termfont="${termfont/.pcf}" termfont="${termfont/:*}" ;;