#2814·polybar

[Bug]: `format-padding` only applies to left side of workspaces block in i3 module

Author: gctypoCreated Sep 5, 2022Updated Mar 27, 2026
Labelsbughelp wantedconfirmedgood first issue

Checklist

  • I have read the appropriate section in the contributing guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part
  • I have searched for other open and closed issues that may have already reported this problem
  • I have checked the known issues page for this problem.
  • I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce

  1. Setup i3 module that makes use of format-padding
  2. Launch bar
  3. Open low-numbered workspace and higher-numbered workspace
  4. Observe leftmost workspace has format-padding space to the left of it
  5. Observe rightmost workspace does not

Minimal config

dosini
[bar/main]
monitor = HDMI-1
monitor-strict = false

module-padding = 12px

border-color = #444

overline-size = 4
underline-size = 4

font-0 = "Liberation Sans:size=11;4"

modules-left = i3

height = 28

border-top-size = 4px
border-bottom-size = 4px

padding = 20px


[module/i3]
type = internal/i3

pin-workspaces = true
index-sort = true
show-urgent = true

fuzzy-match = true

format = "<label-state> <label-mode> "
format-background = #046
format-padding = 13px

ws-label = %index%
label-focused = ${self.ws-label}
label-unfocused = ${self.ws-label}
label-visible = ${self.ws-label}
label-urgent = ${self.ws-label}

background = #bbb
foreground = #444

; fg/bg settings exist to make the issue most visible
ws-padding = 8px
label-focused-padding = ${self.ws-padding}
label-focused-background = #860
label-focused-foreground = #eee
label-focused-overline = #608
label-focused-underline = #608

label-unfocused-padding = ${self.ws-padding}
label-unfocused-background = ${self.background}
label-unfocused-foreground = ${self.foreground}

label-mode-padding = 8px
label-mode-background = #040
label-mode-foreground = #eee

Polybar log

polybar|notice:  Parsing config file: /home/gctypo/.config/polybar/test.ini
polybar|notice:  Loading module 'i3' of type 'internal/i3'
polybar|notice:  Loading module 'title' of type 'internal/xwindow'
polybar|notice:  Loaded 2 modules
polybar|notice:  Loaded font "Liberation Sans:size=11" (name=Liberation Sans, offset=4, file=/usr/share/fonts/liberation/LiberationSans-Regular.ttf)

Expected behavior

Expected format-padding in i3 module to show an equal amount of padding (13px in demo ini) both to the left of leftmost workspace (shows) and right of rightmost workspace (doesn't show).

Actual behavior

Observed format-padding amount of space only applied to left side of leftmost workspace, and is absent after rightmost workspace.

Window Manager and Version

i3-gaps 4.20.1-2

Linux Distribution

Arch Linux

Polybar version

polybar 3.6.3

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/bin/c++
Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/polybar/src=/usr/src/debug -flto=auto -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wsuggest-override
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -Wall -Wextra -Wpedantic -Wsuggest-override  -Wall -Wextra -Wpedantic -Wsuggest-override

Additional Context / Screenshots

Space from format-padding in i3 module is highlighted in teal, which comes from format-background. The space granted from this is only visible on the right side of the workspaces block of the module.

2022-09-05_01-40 2022-09-05_01-40_1

Other colors:

  • Purple over/underline (label-focused-overline = #608)
  • Dark gray bar border (border-color = #444)
  • Gold focused workspace (label-focused-background = #860)
  • Green mode block (label-mode-foreground = #040 - padding inside this block works as expected)
  • Black bar background