i3bar (fallback) font and baseline of the font

I use i3blocks with the font awesome oft font style.
font pango:Font Awesome 5 Free Solid 12 (line from the bar{} block of the .i3/config)

But now there are two Problems:

  1. I can't use words like "music" or "video" for Workspaces anymore since these get substituted by icons

  2. The baseline in the bar is a bit weird (like it can be seen in the Picture below some characters seem to have a lower baseline than others)

    (you see its just the ":" and "%" characters what is a bit weird)

Oh and in addition is it possible to set a font for the text part only because a font like "liberation" doesn't pass all symbols down to font awesome (the fall back font) but interprets some by itself and the other way round interprets font awesome the text part too (and doesn't pass it down to the fallback font)

The answer to both your questions is to use a different font as the primary one for the i3bar and use Font Awesome as a fallback font to display only the icons for the i3blocks modules.
Font Awesome seems to be a good font for icons, but not for text.

First of all I'm not sure how you load i3blocks in your i3bar. The easiest way is to create the folder ~/.config/i3blocks and copy the default i3blocks config file in that folder.

cp /etc/i3blocks.conf ~/.config/i3blocks/config

Then open your i3 config file and replace the entry status_command i3status with status_command i3blocks in the bar {} section. In the same section define a different primary font (for example DejaVu Sans Mono) and Font Awesome as a fallback font.

Something like this:

bar {
    #status_command i3status
    status_command i3blocks
    font pango:DejaVu Sans Mono, Font Awesome 5 Free Solid 12

After that you can edit the modules in the ~/.config/i3blocks/config file and use Font Awesome icons as the label for each module.
For example (date/time module):

# Date Time
command=date '+%Y-%m-%d %H:%M:%S'

replace font_awesome_icon with an icon from here (just copy the icon and paste it in the file).

Regarding the names of the workspaces, if you don't define Font Awesome as the primary font, you can use "normal" text for them - for some reason if you use Font Awesome as the primary font, words that have a corresponding icon (or icon name) in the Font Awesome family (like "home", "database", etc) are replaced by this icon.

An example of i3bar:

Hope that helps!

Hm yes I tried this earlier too (with another "primary" font). My problem was (and is still) that I don't get the battery icons in the bar (they always get interpreted as heart), the sun in the bar (symbol for the brightness) looks a bit weird and I never (with Font Awesome as "primary" font too) got it to be able that the memory icon is interpreted the right way.

Would you mind sending me your config files (or the relevant parts of it)? And which Font Awesome package have you installed? (the otf one?)

Here a image how it looks after making Font Awesome the fallback font

The picture I posted above is from a "test" installation of the i3 edition, I'm actually not using Font Awesome on my system.
The config files on the "test" system are the defaults with only the necessary changes in order to display the Font Awesome icons in the i3bar.
i3 config file: https://pastebin.com/zskwquFT
i3blocks config file: https://pastebin.com/rrj72iRh

I installed the package otf-font-awesome from the community repo.

I'm not using a laptop so I don't get battery or brightness indicators. You'll notice that I added a very simple module in the i3blocks config file to test the Font Awesome battery icon. On the "test" system the icon was displayed correctly in the bar, although it appeared as a "heart" when I opened the config file using Mousepad.

This is how it looks:

Hope that helps!

1 Like

Oh nice your configs helped! My big mistake was to write
font pango:primaryFont, pango:fallbackFont fontSize.
i3 doesn't like the seccond pango:
So the line
font pango: primaryFont, fallbackFont fontSize
worked. (I'm just wondering why it works now, because earlier I had it that way (or at least I think so) and changed it after I saw it somewhere this way. But back then something must have been false no idea what but what's important is that it works now :wink: )

(Little annotation about the battery and the brightness block: The battery block comes with the i3blocks package (or at least the script), the brightness block is a creation of mine)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by