Foundations for terminal font support

This commit is contained in:
Dylan 2016-05-16 21:35:29 +10:00
parent 4f3f24589a
commit b1402c0372

View file

@ -56,7 +56,8 @@ printinfo () {
info "WM Theme" wmtheme
info "Theme" theme
info "Icons" icons
info "Font" font
info "Terminal Emulator" term
info "Terminal Font" termfont
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
@ -1734,6 +1735,38 @@ getfont () {
# }}}
# Terminal Emulator {{{
getterm () {
parent="$(ps -p ${1:-$PPID} -o ppid=)"
name="$(ps -p $parent -o comm=)"
case "$name" in
"${SHELL/*\/}" | *"sh") getterm "$parent" ;;
*) term="$name" ;;
esac
}
# }}}
# Terminal Emulator Font {{{
gettermfont () {
[ -z "$term" ] && getterm
case "$term" in
"urxvt"*)
# Need to figure out how to best parse the Xresources file.
;;
"xfce4-terminal")
termfont="$(awk -F '=' '/FontName/ {printf $2}' "${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc")"
;;
esac
}
# }}}
# Disk Usage {{{
getdisk () {