#!/bin/sh getfontdirs() { for i in /etc/X11/xorg.conf-4 /etc/X11/xorg.conf /etc/xorg.conf do if [[ -a "${i}" && -f "${i}" ]]; then grep -v "^#" ${i} | while read a b c d do if [ "${a}" = "FontPath" ]; then g=${b#\"} f=${g%\"} echo ${f%:unscaled}fonts.dir fi done | sort | uniq | while read i do # if [[ -a "${i}" && -f "${i}" ]]; then echo -n ${i}, # fi done return fi done } getfontdirs