[PR] dylanaraps/neofetch#1877 from AtifChy - st xresources patch support
Upstream PR: https://github.com/dylanaraps/neofetch/pull/1877 Thanks to @AtifChy Co-authored-by: AtifChy <iftakhar.awal@yahoo.com>
This commit is contained in:
commit
e3c799ae9e
1 changed files with 15 additions and 6 deletions
21
neofetch
21
neofetch
|
@ -4099,16 +4099,25 @@ END
|
||||||
# like a font definition. NOTE: There is a slight limitation in this approach.
|
# like a font definition. NOTE: There is a slight limitation in this approach.
|
||||||
# Technically "Font Name" is a valid font. As it doesn't specify any font options
|
# Technically "Font Name" is a valid font. As it doesn't specify any font options
|
||||||
# though it is hard to match it correctly amongst the rest of the noise.
|
# though it is hard to match it correctly amongst the rest of the noise.
|
||||||
[[ -n "$binary" ]] &&
|
st_bin=$(strings "$binary")
|
||||||
term_font=$(
|
|
||||||
strings "$binary" |
|
|
||||||
|
|
||||||
grep -m 1 "*font[^2]"
|
# Grab font information from strings in binary.
|
||||||
)
|
term_font=${term_font:-"$(
|
||||||
|
grep -F -m 1 \
|
||||||
|
-e "pixelsize=" \
|
||||||
|
-e "size=" \
|
||||||
|
-e "antialias=" \
|
||||||
|
-e "autohint=" <<< "$st_bin"
|
||||||
|
)"}
|
||||||
|
|
||||||
|
# Grab font information from Xresources.
|
||||||
|
[[ $st_bin == *resource* ]] && {
|
||||||
|
term_font=$(xrdb -query | grep -im 1 -e "^${term/d}"'\**\.*font:' -e '^\*font:' -e '^\*.font:')
|
||||||
|
term_font=$(trim "${term_font/*[\*.]"font:"}")
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
term_font="${term_font/xft:}"
|
term_font="${term_font/xft:}"
|
||||||
term_font="${term_font#*=}"
|
|
||||||
term_font="${term_font/:*}"
|
term_font="${term_font/:*}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue