4

I've trying to use some Font Awesome glyphs as icons for workspaces in i3wm, but I can't get them to display correctly. After reading the answers on this post, I saw that the glyph I want was being taken from the UnDotum font, not Font Awesome.

How can I change this?

EDIT: Seems like a possible solution would be to create my own font and map the glyphs how I want using FontForge, but I'd rather avoid that due to how tedious it seems it will be and the possibility of messing up my fonts.

1 Answer 1

3

Using Pango fontYou can set a list of multiple fonts to use in your ~/.i3/config, either for a specific status bar (workspace names, mode indicators and status messages) or globally (title bars and all status bars). Settings on single status bars override global settings. The first font that provides a certain glyph is then used to draw it.

For example:

font pango:DejaVu Sans Mono, UnDotum, FontAwesome 12

So if a glyph is not providede by DejaVu Sans Mono, it will be looked up in UnDotum (assuming that is the correct name used by the system) and then FontAwesome.

You can get a list of the installed fonts with fc-list and look up the correct name there. For example with fc-list | grep -i dotum.


If you generally prefer FontAwesome but want to use UnDotum for a specific workspace, you also can use Pango markup to change the font only for it. For example:

set $WORKSPACE_X <span font="UnDotum 12">[GLYPH]</span>
workspace $WORKSPACE_X output SOME-DISPLAY
bindkey $mod+x workspace $WORKSPACE_X
bindkey $mod+Shift+x move to workspace $WORKSPACE_X

This will show the the workspace name as "[GLYPH]" with font UnDotum, the markup will not be shown. Replace [GLYPH] with whatever text you want. I strongly suggest using variables for workspace names in order to ensure the exact same name and markup on all occurences.

1
  • Perfect! Works like a charm. I'll definitely look into pango now that I'm using i3 more.
    – carreter
    May 30, 2016 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .