mirror of
https://github.com/dylanaraps/neofetch.git
synced 2026-01-06 23:13:15 +00:00
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'
This commit is contained in:
2
neofetch
2
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/:*}"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user