Foundations for terminal font support

This commit is contained in:
Dylan 2016-05-16 21:35:29 +10:00
parent 4f3f24589a
commit b1402c0372
1 changed files with 34 additions and 1 deletions

View File

@ -56,7 +56,8 @@ printinfo () {
info "WM Theme" wmtheme info "WM Theme" wmtheme
info "Theme" theme info "Theme" theme
info "Icons" icons info "Icons" icons
info "Font" font info "Terminal Emulator" term
info "Terminal Font" termfont
info "CPU" cpu info "CPU" cpu
info "GPU" gpu info "GPU" gpu
info "Memory" memory 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 {{{ # Disk Usage {{{
getdisk () { getdisk () {