termfont: xterm support
This commit is contained in:
parent
abb110b57f
commit
5438078888
1 changed files with 9 additions and 5 deletions
14
neofetch
14
neofetch
|
@ -1760,18 +1760,22 @@ gettermfont () {
|
||||||
[ -z "$term" ] && getterm
|
[ -z "$term" ] && getterm
|
||||||
|
|
||||||
case "$term" in
|
case "$term" in
|
||||||
"urxvt"*)
|
"urxvt"* | "xterm")
|
||||||
termfont="$(awk -F ': ' '!/^($|!)/ && /\*font/ {printf $2}' "$HOME/.Xresources")"
|
# 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
|
||||||
|
|
||||||
|
# Xresources has two different font syntax, this checks which
|
||||||
|
# one is in use and formats it accordingly.
|
||||||
case "$termfont" in
|
case "$termfont" in
|
||||||
"xft:"*)
|
"xft:"*)
|
||||||
termfont=${termfont/xft:}
|
termfont=${termfont/xft:}
|
||||||
termfont=${termfont/:*}
|
termfont=${termfont/:*}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"-"*)
|
"-"*) termfont="$(awk -F '\\-' '{printf $3}' <<< "$termfont")" ;;
|
||||||
termfont="$(awk -F '\\-' '{printf $3}' <<< "$termfont")"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue