I3 Blocks and Scripts Icons Broken

Some time ago, I realized that some of my icons were broken on my bar and power menu. Checking with the i3 config, I have font pango: Noto Sans Regular 10 near the top, and the same line later in the config, nested in the bar section (below).

#start of bar section
bar {
    font pango: Noto Sans Regular 10
    position top
    tray_padding 0
    status_command i3blocks -c ~/.config/i3/i3blocks.conf
    colors {

        separator $red
        # bar background color
        background $bg
        # text color used for blocks that do not have a color specified.
        statusline $yellow
        # workspaces section
        #                    border  backgr. text
        focused_workspace    $aqua $aqua $darkgrey
        inactive_workspace   $darkgrey $darkgrey $yellow
        active_workspace     $darkgrey $darkgrey $yellow
        urgent_workspace     $red $red $bg
    }
}
#end of bar section

Checking font-manager(aur), there’s no font name Noto Sans Regular. Plenty of other Noto Sans fonts, though. I tried reinstalling noto-fonts(aur) through yay, but to no avail.


Thank you in advance!

Can you check if you have font awesome installed?

$ pacman -Q ttf-font-awesome

Also,

If you’re using Noto Sans font for your i3bar, you probably need to have ttf-noto-nerd installed, depending on the icons you’re using on the bar.

$ pacman -Q ttf-font-awesome
ttf-font-awesome 6.5.1-1

ttf-noto-nerd wasn’t installed, so I fixed that.

$ pacman -Q ttf-noto-nerd
ttf-noto-nerd 3.1.1-1

The issue persists after reboot.

From what I see, there are two separate issues here. One is the terminal fonts. And the second is the fonts on the i3bar. Let’s deal with each one separately.

What terminal and terminal fonts are you using in this screenshot?

xfce4-terminal with Source Code Pro Regular

First of all, post the output of:

$ fc-list | grep "Sauce"

If I’m not mistaken, Source Code Pro is not a nerd font. It is the original unpatched version of the Source Code Pro font. The patched (or “nerd”) version of Source Code Pro should be referred to as SauceCodePro, I think.

If fc-list | grep "Sauce" returns an empty list, then you should install ttf-sourcecodepro-nerd, and then go to your xfce4-terminal’s preference and change the terminal fonts to SauceCodePro.

Regarding the fonts on the i3bar, try to add FontAwesome to your bar config like this:

#start of bar section
bar {
    font pango: Noto Sans Regular, FontAwesome 10
    position top
    tray_padding 0
    status_command i3blocks -c ~/.config/i3/i3blocks.conf

After that, reload your i3 config with Ctrl + Shift + C (or your own keybinding if you’ve changed the defaults).

$ fc-list | grep "Sauce" returned nothing, so I installed ttf-sourcecodepro-nerd. I went to preferences, but “SauceCodePro” is not listed. There’s “SourceCodeVF”, which I don’t remember being there, but the icon issue persists so that may be unrelated. Changing the bar section as you indicated fixed the icons on my bar, but the power menu is still broken. I tried changing the i3 font defined at the top of the i3 config to the same font, but no dice.

The font setting at the top of the i3 config is for window decorations and has nothing to do with the issue.

That’s impossible.

If you’ve installed the ttf-sourcecodepro-nerd package and updated your font cache (you don’t usually have to update the font cache manually because there is a pacman hook to do this for you automatically), you should be able to see SauceCodePro listed in your xfce4-terminal preference window after you restart xfce4-terminal. I know this because I have tested it myself:

Run fc-list | grep "Sauce" again after you’ve installed ttf-sourcecodepro-nerd. If the fonts are indeed listed by fc-list, then all is good. Restart xfce4-terminal and go to the preference window. You should see a bunch of SauceCodePro entries there. If you don’t see them, then something probably went wrong with the installation. Perhaps the font cache wasn’t updated, in which case you should run:

$ fc-cache -f -v

Having said that, changing the xfce4-terminal fonts to SauceCodePro will only allow the correct icons to be displayed inside your terminal—e.g. when you open the powermenu script in the terminal using nano or vim. When you actually launch the powermenu, it is rofi that is responsible for rendering the fonts. Therefore, you probably need to change your rofi settings to include SauceCodePro as well.

Just went back to the terminal preferences, and SauceCodePro is now listed. Which is odd, as I did Win+Shift+C, Win+Shift+R, and a reboot before checking last time. Maybe it just didn’t refresh the cache, as you mentioned. With it now selected, icons in the terminal are working just fine. Editing the rofi powermenu config to the FontAwesome version also fixed my powermenu!

Thanks for your help!

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