Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get the name of the default font (and default monospace font), in the format:

Ubuntu Mono:size=12:antialias=false

I'm aware of fc-list which gives me a list of all the fonts, but how can I know which one is the default font?

Use: I'm trying to launch xterm like this: xterm -fa Ubuntu Mono:size=12:antialias=false and auto-detect the default monospace font.

share|improve this question
up vote 1 down vote accepted

Use this, substituing monospace-font-name with font-name if you want the normal font instead:

# for normal font:
# font="$(gsettings get org.gnome.desktop.interface font-name)"

# for monospace font:
font="$(gsettings get org.gnome.desktop.interface monospace-font-name)"

font_name="${font% *}"
font_size="${font##* }"

echo "The font is:"
echo "$font_name:size=$font_size:antialias=false"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.