mirror of
https://github.com/dylanaraps/neofetch.git
synced 2026-01-05 22:59:06 +00:00
Do a case insensitive grep instead of duplicating awk commands
This commit is contained in:
9
neofetch
9
neofetch
@@ -1760,12 +1760,9 @@ gettermfont () {
|
|||||||
[ -z "$term" ] && getterm
|
[ -z "$term" ] && getterm
|
||||||
|
|
||||||
case "$term" in
|
case "$term" in
|
||||||
"urxvt"* | "xterm")
|
"urxvt" | "urxvtd" | "xterm")
|
||||||
# Check for a different font line if the term is urxvt or xterm.
|
termfont="$(grep -i "${term/d}\*font" "$HOME/.Xresources")"
|
||||||
case "$term" in
|
termfont=${termfont/*font: }
|
||||||
"urxvt"*) termfont="$(awk -F ': ' '!/^($|!)/ && /t\*font/ {printf $2}' "$HOME/.Xresources")" ;;
|
|
||||||
"xterm") termfont="$(awk -F ': ' '!/^($|!)/ && /m\*font/ {printf $2}' "$HOME/.Xresources")" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Xresources has two different font syntax, this checks which
|
# Xresources has two different font syntax, this checks which
|
||||||
# one is in use and formats it accordingly.
|
# one is in use and formats it accordingly.
|
||||||
|
|||||||
Reference in New Issue
Block a user