Polybar and Fonts

Ok…I have 4 bars being loaded. I have icons in 3 of the bars but my 4th bar I cannot for the life of me get icons to show up. I have even copied icons from the other bars to put in my 4th bar and added the font but still no dice. I can see in the logs that the font gets loaded without issue. I use fontmatrix to copy and paste the icon. Would anyone have any idea why I can’t get icons to show up in my 4th bar?? Here is my config:

;==========================================================
;
;
;   ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗
;   ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
;   ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝
;   ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗
;   ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║
;   ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
;
;
;   To learn more about how to configure Polybar
;   go to https://github.com/polybar/polybar
;
;   The README contains a lot of information
;
;==========================================================

[global/wm]

margin-bottom = 0
margin-top = 0

include-file = ~/.config/polybar/Rich/modules.ini

[colors]
background = #aa000000
foreground = ${xrdb:color7:#222}
foreground-alt = ${xrdb:color7:#222}
primary = ${xrdb:color1:#222}
secondary = ${xrdb:color2:#222}
alert = ${xrdb:color3:#222}

[settings]
screenchange-reload = true
pseudo-transparency = true

######################################################

[bar/bar1]
width = 100%
height = 20pt
radius = 6
monitor = HDMI-0
dpi = 96

; Text
font-0 = "JetBrainsMono:style=Bold:size=9;2"
; Icons
font-1 = "Material Design Icons Desktop:size=13;3"
font-2 = "Font Awesome 6 Free Solid:size=10;2"
; Icons Fonts
font-3 = feather:style=Medium:size=12;3

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3pt

border-size = 0pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.foreground}

modules-left = launcher
modules-center = bspwm
modules-right = 

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

######################################################

[bar/bar2]
width = 100%
height = 20pt
radius = 6
monitor = DP-2
dpi = 96

; Text
font-0 = "JetBrainsMono:style=Bold:size=9;2"
; Icons
font-1 = "Material Design Icons Desktop:size=13;3"
font-2 = "Font Awesome 6 Free Solid:size=10;2"
; Icons Fonts
font-3 = feather:style=Medium:size=12;3

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3pt

border-size = 0pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.foreground}

modules-left = 
modules-center = bspwm
modules-right = pulseaudio tray

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

######################################################

[bar/bar3]
width = 100%
height = 20pt
radius = 6
monitor = HDMI-0
dpi = 96
bottom = true
fixed-center = true

; Text
font-0 = "JetBrainsMono:style=Bold:size=9;2"
; Icons
font-1 = "Material Design Icons Desktop:size=13;3"
font-2 = "Font Awesome 6 Free Solid:size=10;2"
; Icons Fonts
font-3 = feather:style=Medium:size=12;3
font-4 = "JetBrainsMono Nerd Font Mono:style=Regular"

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3pt

border-size = 0pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.foreground}

modules-left = 
modules-center = updates
modules-right = 

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

######################################################

[bar/bar4]
width = 100%
height = 20pt
radius = 6
monitor = DP-2
dpi = 96
bottom = true
fixed-center = true

; Text
font-0 = "JetBrainsMono:style=Bold:size=9;2"
; Icons
font-1 = "Material Design Icons Desktop:size=13;3"
font-2 = "Font Awesome 6 Free Solid:size=10;2"
; Icons Fonts
font-3 = feather:style=Medium:size=12;3

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3pt

border-size = 0pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.foreground}

modules-left = wallpaper_changer
modules-center = mpd_control
modules-right = 

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

######################################################

Here is my modules:

; __  __           _       _           
;|  \/  | ___   __| |_   _| | ___  ___   z0mbi3
;| |\/| |/ _ \ / _` | | | | |/ _ \/ __|  https://github.com/gh0stzk/dotfiles
;| |  | | (_) | (_| | |_| | |  __/\__ \  [email protected]
;|_|  |_|\___/ \__,_|\__,_|_|\___||___/
;                                      By z0mbi3


[module/date]
type = internal/date

interval = 1.0

time = %I:%M %P
;date-alt = " %a, %d %b %y"

format = <label>
format-prefix = ""
format-prefix-padding = 3pt

label = "%{A1:~/.config/polybar/scripts/OpenApps --calendar:}%time%%{A}"

######################################################

[module/color-switch]
type = custom/text
content = 

background = ${color.background}
foreground = ${color.foreground}
content-padding = 1

click-left = ~/.config/polybar/cuts/scripts/pywal.sh $HOME/Pictures/Wallpaper &

#####################################################

[module/weather]
type = custom/script
exec = ~/.config/polybar/scripts/Weather wmodule
interval = 900
format = <label>
label = "%output%"

######################################################

[module/pulseaudio]
type = internal/pulseaudio
use-ui-max = true
interval = 5

format-volume = <label-volume>
format-volume-prefix = ""
format-volume-prefix-padding = 3pt
label-volume = "%percentage%"
label-volume-foreground = ${colors.foreground}

format-muted = <label-muted>
format-muted-prefix = ""
format-muted-prefix-padding = 3pt
label-muted = "Muted"
label-muted-foreground = ${colors.foreground}

click-right = ~/.config/polybar/scripts/OpenApps --soundcontrol

######################################################

[module/bspwm]
type = internal/bspwm

enable-click = true
enable-scroll = true
reverse-scroll = true
pin-workspaces = true
occupied-scroll = false

ws-icon-0 = 1;󰆍
ws-icon-1 = 2;󰝰
ws-icon-2 = 3;󰇧
ws-icon-3 = 4;󰍩
ws-icon-4 = 5;󰏖
ws-icon-5 = 6;󰊴
ws-icon-6 = 7;󰆍
ws-icon-7 = 8;󰝰
ws-icon-8 = 9;󰇧
ws-icon-9 = 10;󰍩
ws-icon-default = "♟"


format = <label-state>

label-focused = 󱓇
label-focused-foreground = ${colors.foreground}

label-occupied = %icon%
label-occupied-foreground= ${colors.foreground}

label-urgent = %icon%

label-empty = %icon%
label-empty-foreground = ${colors.foreground}

label-separator = "|"
label-separator-padding = 2
label-separator-foreground = ${colors.foreground}

######################################################

[module/launcher]
type = custom/text

label = 󰣇󰫿󰫰󰫵
label-foreground = ${colors.foreground}
label-font = 2

click-left = ~/.config/polybar/scripts/OpenApps --menu
#click-right = ~/.config/polybar/scripts/RiceSelector

######################################################

[module/sep]
type = custom/text
label = "|"
label-padding = 5pt

######################################################

[module/mpd_control]
type            = internal/mpd

interval        = 2
format-online   = <icon-prev><toggle><icon-next>
format-offline  = <label-offline>
format-offline-foreground = ${colors.foreground}
label-offline   = "󰝛 no Music"
icon-play       = "  "
icon-pause      = "  "
icon-stop       = "  "
icon-prev       = ""
icon-next       = ""

######################################################

[module/systray]
type=custom/ipc
hook-0=echo "    "
hook-1=echo "    "
click-left= ~/.config/polybar/scripts/systray
initial=2
;;format-font=2
format-foreground=${colors.foreground}

####################################################

[module/tray]
type = internal/tray

format-margin = 8px
tray-spacing = 8px

####################################################

[module/wallpaper_changer]
type = custom/text
content = 

background = ${color.background}
foreground = ${color.foreground}
content-padding = 1

click-left = ~/.config/polybar/cuts/scripts/pywal.sh $HOME/Pictures/Wallpaper &

#####################################################

[module/updates]
type = custom/script
#exec = ~/.config/polybar/scripts/Updates --get-updates
exec = ~/.config/polybar/scripts/updates-pacman-aurhelper.sh &
interval = 120

format = <label>
format-prefix = ""
format-prefix-padding = 3pt
label = "%output%"

#click-left = ~/.config/polybar/scripts/updates-pacman-aurhelper.sh 
#click-right = ~/.config/polybar/scripts/OpenApps --checkupdates

Here is my inxi:

System:
  Kernel: 6.7.5-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=6175aced-ff46-4d8b-8a4c-54245f06370a rw rootflags=subvol=@
    quiet loglevel=3 ibt=off
  Desktop: bspwm v: 0.9.10 with: krunner,polybar
    tools: xscreensaver,xscreensaver-systemd avail: physlock,xfce4-screensaver
    vt: 2 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: Z390-A PRO (MS-7B98) v: 1.0
    serial: <superuser required> uuid: <superuser required>
    UEFI: American Megatrends v: 1.B0 date: 08/10/2020
CPU:
  Info: model: Intel Core i7-9700K bits: 64 type: MCP arch: Coffee Lake
    gen: core 9 level: v3 note: check built: 2018 process: Intel 14nm family: 6
    model-id: 0x9E (158) stepping: 0xD (13) microcode: 0xFA
  Topology: cpus: 1x cores: 8 smt: <unsupported> cache: L1: 512 KiB
    desc: d-8x32 KiB; i-8x32 KiB L2: 2 MiB desc: 8x256 KiB L3: 12 MiB
    desc: 1x12 MiB
  Speed (MHz): avg: 2345 high: 4939 min/max: 800/4900:5000 scaling:
    driver: intel_pstate governor: performance cores: 1: 4935 2: 800 3: 800
    4: 800 5: 800 6: 4889 7: 800 8: 4939 bogomips: 57600
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA TU116 [GeForce GTX 1650 SUPER] vendor: Micro-Star MSI
    driver: nvidia v: 545.29.06 alternate: nouveau,nvidia_drm non-free: 545.xx+
    status: current (as of 2024-02; EOL~2026-12-xx) arch: Turing code: TUxxx
    process: TSMC 12nm FF built: 2018-2022 pcie: gen: 1 speed: 2.5 GT/s
    lanes: 16 link-max: gen: 3 speed: 8 GT/s ports: active: none
    off: DP-2,HDMI-A-1 empty: DP-1,DP-3 bus-ID: 01:00.0 chip-ID: 10de:2187
    class-ID: 0300
  Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.4
    compositor: Picom v: git-89c2c driver: X: loaded: nvidia
    unloaded: modesetting alternate: fbdev,nouveau,nv,vesa
    gpu: nvidia,nvidia-nvswitch display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3840x1080 s-dpi: 81 s-size: 1204x343mm (47.40x13.50")
    s-diag: 1252mm (49.29")
  Monitor-1: DP-2 note: disabled pos: right model: BenQ GW2780
    serial: <filter> built: 2023 res: 1920x1080 hz: 60 dpi: 82 gamma: 1.2
    size: 598x336mm (23.54x13.23") diag: 686mm (27") ratio: 16:9 modes:
    max: 1920x1080 min: 640x480
  Monitor-2: HDMI-A-1 mapped: HDMI-0 note: disabled pos: primary,left
    model: Asus VG278HE serial: <filter> built: 2015 res: 1920x1080 hz: 60
    dpi: 82 gamma: 1.2 size: 598x336mm (23.54x13.23") diag: 686mm (27")
    ratio: 16:9 modes: max: 1920x1080 min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2
    drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11: drv: nvidia
    inactive: wayland,device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 545.29.06
    glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce GTX 1650
    SUPER/PCIe/SSE2 memory: 3.91 GiB
  API: Vulkan v: 1.3.276 layers: 1 device: 0 type: discrete-gpu name: NVIDIA
    GeForce GTX 1650 SUPER driver: nvidia v: 545.29.06 device-ID: 10de:2187
    surfaces: xcb,xlib
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA TU116 High Definition Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:1aeb class-ID: 0403
  API: ALSA v: k6.7.5-zen1-1-zen status: kernel-api
    tools: alsactl,alsamixer,amixer
  Server-1: PipeWire v: 1.0.3 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I219-V vendor: Micro-Star MSI driver: e1000e
    v: kernel port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15bc class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 3000
    bus-ID: 03:00.0 chip-ID: 10ec:8161 class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: tun0 state: unknown speed: 10000 Mbps duplex: full mac: N/A
  Info: services: NetworkManager, smbd, systemd-timesyncd
Bluetooth:
  Device-1: ASUSTek ASUS USB-BT500 driver: btusb v: 0.8 type: USB rev: 1.1
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-6:3 chip-ID: 0b05:190e
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.1
    lmp-v: 10 status: discoverable: no pairing: no class-ID: 6c0104
Drives:
  Local Storage: total: 4.55 TiB used: 376.19 GiB (8.1%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Seagate
    model: WDS200T3X0C-00SJG0 size: 1.82 TiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 102430WD temp: 47.9 C scheme: MBR
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 4B6Q scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 1B6Q scheme: GPT
  ID-4: /dev/sdc maj-min: 8:32 vendor: Samsung model: SSD 860 EVO 1TB
    size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 4B6Q scheme: GPT
Partition:
  ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%) used: 163.9 GiB (8.8%)
    fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 724 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 163.9 GiB (8.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 163.9 GiB (8.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 163.9 GiB (8.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 62.73 GiB used: 3.5 MiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 8 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 34.0 C pch: 49.0 C mobo: N/A gpu: nvidia
    temp: 47 C
  Fan Speeds (rpm): N/A gpu: nvidia fan: 0%
Info:
  Memory: total: 64 GiB note: est. available: 62.73 GiB used: 6.42 GiB (10.2%)
  Processes: 377 Power: uptime: 5d 1h 45m states: freeze,mem,disk
    suspend: deep avail: s2idle wakeups: 0 hibernate: platform avail: shutdown,
    reboot, suspend, test_resume image: 25.05 GiB
    services: power-profiles-daemon,upowerd Init: systemd v: 255
    default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 2016 libs: 463 tools: octopi,paru Compilers:
    clang: 16.0.6 gcc: 13.2.1 Shell: garuda-inxi default: Zsh v: 5.9
    running-in: alacritty inxi: 3.3.33
Garuda (2.6.23-1):
  System install date:     2023-12-28
  Last full system update: 2024-02-23 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut nvidia-dkms
  Windows dual boot:       No/Undetected
  Failed units:            

Any help would be greatly appreciated. I am just at a loss here…

Reboot, please.

1 Like

No idea if it matters, the 3rd bar has font-4 = "JetBrainsMono Nerd Font Mono:style=Regular" and the 4th does not. Maybe the missing icons are from the nerd font and those on the 1st and 2nd bars are from the font awesome?
It would also help to know if and what errors are displayed running polybar from terminal, or in the log, is there anything like Dropping unmatched character?
I’m not using polybar though, just thinking out loud.

2 Likes

I did reboot this morning but unfortunately that didn’t help any. I appreciate your reply though thank you.

You were correct about the fonts. Except I was troubleshooting bar3. I had a backup of my original modules.ini and config.ini. I copied and pasted the updates module and the font section of that bar and it worked. I guess I was just so tired last night and wasn’t thinking straight. This morning my head is clear :slight_smile:
If anyone is interested this is what worked for me:

[bar/bar3]
width = 100%
height = 20pt
radius = 6
monitor = HDMI-0
dpi = 96
bottom = true
fixed-center = true

; Text
font-0 = "JetBrainsMono:style=Bold:size=9;2"
; Icons
font-1 = "Font Awesome 6 Free Solid:size=10;2"

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3pt

border-size = 0pt
border-color = #00000000

padding-left = 0
padding-right = 1

module-margin = 1

separator = |
separator-foreground = ${colors.foreground}

modules-left = 
modules-center = updates
modules-right = 

cursor-click = pointer
cursor-scroll = ns-resize

enable-ipc = true

; wm-restack = generic
wm-restack = bspwm
; wm-restack = i3

; override-redirect = true

and my updates module:

[module/updates]
type = custom/script
exec = ~/.config/polybar/scripts/Updates --get-updates
interval = 120

format = <label>
format-prefix = ""
format-prefix-padding = 3pt
label = "%output%"

click-left = ~/.config/polybar/scripts/OpenApps --update
click-right = ~/.config/polybar/scripts/OpenApps --checkupdates
1 Like

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