Merge pull request #936 from aidanharris/xterm-font
Correctly handle XTerm.vt100.faceName
This commit is contained in:
commit
ece67e3691
1 changed files with 13 additions and 1 deletions
14
neofetch
14
neofetch
|
@ -2194,12 +2194,24 @@ END
|
|||
;;
|
||||
|
||||
"urxvt" | "urxvtd" | "rxvt-unicode" | "xterm")
|
||||
term_font="$(grep -i "${term/d}\**\.*font" < <(xrdb -query))"
|
||||
xrdb="$(xrdb -query)"
|
||||
term_font="$(grep -i "${term/d}\**\.*font" <<< "$xrdb")"
|
||||
term_font="${term_font/*"*font:"}"
|
||||
term_font="${term_font/*".font:"}"
|
||||
term_font="${term_font/*"*.font:"}"
|
||||
term_font="$(trim "$term_font")"
|
||||
|
||||
if [[ -z "$term_font" && "$term" == "xterm" ]]; then
|
||||
term_font="$(grep -E '^XTerm.vt100.faceName' <<< "$xrdb")"
|
||||
term_font="${term_font/*"faceName:"}"
|
||||
fi
|
||||
|
||||
# xft: isn't required at the beginning so we prepend it if it's missing
|
||||
if [[ "${term_font:0:1}" != "-" && \
|
||||
"${term_font:0:4}" != "xft:" ]]; then
|
||||
term_font="xft:$term_font"
|
||||
fi
|
||||
|
||||
# Xresources has two different font formats, this checks which
|
||||
# one is in use and formats it accordingly.
|
||||
case "$term_font" in
|
||||
|
|
Loading…
Reference in a new issue