polybar/polybar

[Bug]: i3: `pin-workspaces` makes i3 module to not show up in one specific monitor

Open

#3,179 opened on Oct 18, 2024

View on GitHub
 (4 comments) (0 reactions) (0 assignees)C++ (684 forks)batch import
bugconfirmedhelp wanted

Repository metrics

Stars
 (13,262 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Pin workspaces to outputs on i3 config:

# Workspace bindings (for multiscreeners)
workspace 1 output HDMI-0
workspace 3 output HDMI-0
workspace 5 output HDMI-0
workspace 7 output HDMI-0
workspace 9 output HDMI-0
workspace 2 output DP-0
workspace 4 output DP-0
workspace 6 output DP-0
workspace 8 output DP-0
workspace 10 output DP-0

Run polybar with pin-workspaces = true, specifying a screen:

MONITOR=DP-0 polybar --config=/tmp/config-minimal.ini

For DP-0, it works fine: Image

For HDMI-0, the bar is empty:

MONITOR=HDMI-0 polybar --config=/tmp/config-minimal.ini

Image

Scrolling the bar on DP-0 causes workspaces to be switched as expected, but on HDMI-0 causes polybar to log:

warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found

xrandr output:

Screen 0: minimum 8 x 8, current 5120 x 1440, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
   2560x1440    143.93*+ 120.00    59.95  
   3840x2160     59.94    50.00    29.97    25.00    23.98  
   1920x1080    119.88    60.00    59.94    50.00  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
DP-0 connected 2560x1440+2560+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440    144.00*+ 120.00    99.90    59.95  
   1920x1080     74.91    60.00    59.94    50.00  
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      59.96  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   720x480       59.94  
   640x480       75.00    59.94    59.93  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1-0 disconnected (normal left inverted right x axis y axis)
DP-1-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 700mm x 390mm
   2560x1440    164.96*+ 143.97   120.00    99.95    59.95  
   1920x1080    119.88   100.00    60.00    59.94    50.00  
   1280x720      59.94    50.00  
   1024x768      60.00  
   800x600       60.32  
   720x480       59.94  
   640x480       59.94    59.93  
DP-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
DP-1-3 disconnected (normal left inverted right x axis y axis)
DP-1-4 disconnected (normal left inverted right x axis y axis)
DP-1-5 disconnected (normal left inverted right x axis y axis)
  2560x1440 (0x1c5) 241.500MHz +HSync -VSync
        h: width  2560 start 2608 end 2640 total 2720 skew    0 clock  88.79KHz
        v: height 1440 start 1443 end 1448 total 1481           clock  59.95Hz
  1920x1080 (0x1c6) 296.700MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock 134.86KHz
        v: height 1080 start 1084 end 1089 total 1125           clock 119.88Hz
  1920x1080 (0x1c7) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x1c8) 148.350MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.43KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  59.94Hz
  1920x1080 (0x1c9) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1280x720 (0x1ca) 74.180MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  44.96KHz
        v: height  720 start  725 end  730 total  750           clock  59.94Hz
  1280x720 (0x1cb) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1024x768 (0x1cc) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x1cd) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  720x480 (0x1cf) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x1d0) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  640x480 (0x1d1) 25.170MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.46KHz
        v: height  480 start  490 end  492 total  525           clock  59.93Hz

Minimal config

[bar/i3]
monitor = ${env:MONITOR:}
width = 100%

height = 32
;offset-x = 1%
;offset-y = 1900
radius = 0
fixed-center = false
bottom = true

font-0 = FiraCode Nerd Font:size=12;2
font-1 = Fira Mono:size=12;2

modules-left = i3

scroll-up = #i3.prev
scroll-down = #i3.next

[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
pin-workspaces = true

label-mode-padding = 1
label-mode-foreground = #000
label-mode-background = ${colors.primary}

Polybar log

11:13:30 ~ $> MONITOR=HDMI-0 polybar --config=/tmp/config-minimal.ini
notice: Parsing config file: /tmp/config-minimal.ini
notice: Loading module 'i3' of type 'internal/i3'
error: Invalid value for "module/i3.label-mode-background", using default value (reason: The reference ${colors.primary} does not exist (no fallback set))
notice: Loaded 1 modules
notice: Loaded font "FiraCode Nerd Font:size=12" (name=FiraCode Nerd Font, offset=2, file=/usr/share/fonts/TTF/FiraCodeNerdFont-Regular.ttf)
notice: Loaded font "Fira Mono:size=12" (name=Fira Mono, offset=2, file=/usr/share/fonts/TTF/FiraMono-Regular.ttf)
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found
warn: module/i3: Current workspace not found

Expected behavior

Polybar should work on both outputs, and show workspaces present on each of those individually. This config has been working for me for years, but suddenly it has stopped to.

Actual behavior

i3 module is empty for one of the two monitors. This happens both when only one bar is active, or when both are.

Window Manager and Version

i3 version 4.23 © 2009 Michael Stapelberg and contributors

Linux Distribution

Arch linux

Polybar version

polybar 3.7.2

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=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/polybar/src=/usr/src/debug/polybar -flto=auto -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override
Linker flags: -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now          -Wl,-z,pack-relative-relocs -flto=auto -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override

Additional Context / Screenshots

Full i3 config: config.txt

Contributor guide