neofetch: Fix urxvt font, closes #1253
This commit is contained in:
parent
1c9db4af1a
commit
9bb236eb4b
1 changed files with 16 additions and 16 deletions
32
neofetch
32
neofetch
|
@ -3186,32 +3186,32 @@ END
|
|||
"$termite_config")"
|
||||
;;
|
||||
|
||||
"urxvt" | "urxvtd" | "rxvt-unicode" | "xterm")
|
||||
xrdb="$(xrdb -query)"
|
||||
term_font="$(grep -im 1 -e "^${term/d}"'\**\.*font' -e '^\*font' <<< "$xrdb")"
|
||||
term_font="${term_font/*"*font:"}"
|
||||
term_font="${term_font/*".font:"}"
|
||||
term_font="${term_font/*"*.font:"}"
|
||||
term_font="$(trim "$term_font")"
|
||||
urxvt|urxvtd|rxvt-unicode|xterm)
|
||||
xrdb=$(xrdb -query)
|
||||
term_font=$(grep -im 1 -e "^${term/d}"'\**\.*font:' -e '^\*font:' <<< "$xrdb")
|
||||
term_font=${term_font/*"*font:"}
|
||||
term_font=${term_font/*".font:"}
|
||||
term_font=${term_font/*"*.font:"}
|
||||
term_font=$(trim "$term_font")
|
||||
|
||||
[[ -z "$term_font" && "$term" == "xterm" ]] && \
|
||||
term_font="$(grep '^XTerm.vt100.faceName' <<< "$xrdb")"
|
||||
[[ -z $term_font && $term == xterm ]] && \
|
||||
term_font=$(grep '^XTerm.vt100.faceName' <<< "$xrdb")
|
||||
|
||||
term_font="$(trim "${term_font/*"faceName:"}")"
|
||||
term_font=$(trim "${term_font/*"faceName:"}")
|
||||
|
||||
# xft: isn't required at the beginning so we prepend it if it's missing
|
||||
[[ "${term_font:0:1}" != "-" && "${term_font:0:4}" != "xft:" ]] && \
|
||||
term_font="xft:$term_font"
|
||||
[[ ${term_font:0:1} != '-' && ${term_font:0:4} != xft: ]] && \
|
||||
term_font=xft:$term_font
|
||||
|
||||
# Xresources has two different font formats, this checks which
|
||||
# one is in use and formats it accordingly.
|
||||
case $term_font in
|
||||
*"xft:"*)
|
||||
term_font="${term_font/xft:}"
|
||||
term_font="${term_font/:*}"
|
||||
*xft:*)
|
||||
term_font=${term_font/xft:}
|
||||
term_font=${term_font/:*}
|
||||
;;
|
||||
|
||||
"-"*)
|
||||
-*)
|
||||
IFS=- read -r _ _ term_font _ <<< "$term_font"
|
||||
;;
|
||||
esac
|
||||
|
|
Loading…
Reference in a new issue