polybar / polybar

A fast and easy-to-use status bar
https://polybar.github.io
MIT License
14.21k stars 710 forks source link

[Bug]: no background for label-occupied in xworkspaces module resulting in weird visual bug #2923

Closed miaaaa0a closed 1 year ago

miaaaa0a commented 1 year ago

Checklist

Steps to reproduce

I'm running polybar on Arch Linux with i3 and picom. Recently I've tried to redesign my config by making the bar transparent with the modules basically floating, but I've run into an issue with the xworkspaces module.

The label-occupied label doesn't have a background parameter, and instead it uses the background of the bar it was placed on. This creates a problem where if I want to have a transparent background, an occupied workspace will also have a transparent background, which I don't want.

This issue is partially solved by using format-background, but it results in this happening: image

The occupied workspaces on the left have a normal background, but the ones on the right don't.

Minimal config

[colors]
background = #11111b00
background-alt = #31324f
module-bg = #1e1e2e
foreground = #cdd6f4
disabled = #7f849c
mauve = #cba6f7
green = #a6e3a1

[bar/workspaces]
background = ${colors.background}
bottom = false
width = 100%
module-margin = 0
modules-left = xworkspaces

[module/xworkspaces]
type = internal/xworkspaces

label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline = ${colors.mauve}
label-active-padding = 1

label-occupied = %name%
label-occupied-padding = 1

label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1

label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1

format-background = ${colors.module-bg}
format-foreground = ${colors.foreground}

[settings]
pseudo-transparency = true

Polybar log

polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 665)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink 
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|error: tray: Failed to put tray above 0x0e00002 in the stack (XCB_MATCH (8))
polybar|warn:  Systray selection already managed (window=0x100000d)
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  pulseaudio: using default sink auto_null
polybar|notice:  pulseaudio: using default sink auto_null
polybar|notice:  pulseaudio: using default sink auto_null
polybar|notice:  pulseaudio: using default sink auto_null
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 20541)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|error: tray: Failed to put tray above 0x2400002 in the stack (XCB_MATCH (8))
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 20628)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 20883)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 20992)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|error: tray: Failed to put tray above 0x2a00002 in the stack (XCB_MATCH (8))
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 21090)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|error: tray: Failed to put tray above 0x2200002 in the stack (XCB_MATCH (8))
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 21176)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|error: tray: Failed to put tray above 0x2200002 in the stack (XCB_MATCH (8))
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|error: Uncaught exception, shutting down: Undefined bar: top. Available bars: workspaces
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|error: Uncaught exception, shutting down: Undefined bar: top. Available bars: workspaces
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|error: Uncaught exception, shutting down: Undefined bar: top. Available bars: workspaces
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|error: Uncaught exception, shutting down: Undefined bar: top. Available bars: workspaces
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 24006)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)
polybar|notice:  Received signal(15): Terminated
polybar|notice:  Termination signal received, shutting down...
polybar|notice:  Parsing config file: /home/nuk/.config/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 24561)
polybar|notice:  Loading module 'xworkspaces' of type 'internal/xworkspaces'
polybar|error: Invalid value for "module/xworkspaces.label-urgent-background", using default value (reason: The reference ${colors.alert} does not exist (no fallback set))
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'dummy' of type 'custom/text'
polybar|notice:  Loading module 'xkeyboard' of type 'internal/xkeyboard'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'pulseaudio' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.pci-0000_07_00.6.analog-stereo
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'rounded-prefix' of type 'custom/text'
polybar|notice:  Loading module 'temp' of type 'custom/script'
polybar|notice:  Loaded 12 modules
polybar|notice:  Loaded font "jetbrainsmono nerd font" (name=JetBrainsMono Nerd Font, offset=2, file=/home/nuk/.local/share/fonts/JetBrains Mono Nerd Font Complete Bold.ttf)
polybar|notice:  Loaded font "powerline extra symbols:size=21" (name=Powerline Extra Symbols, offset=4, file=/home/nuk/.local/share/fonts/PowerlineExtraSymbols.otf)
polybar|notice:  Loaded font "noto sans cjk jp" (name=Noto Sans CJK JP, offset=2, file=/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc)

Expected behavior

Background of all occupied workspaces are the same color

Actual behavior

Only the ones on the left are the same color

Window Manager and Version

i3-wm 4.22-3

Linux Distribution

Arch Linux with latest updates

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/polybar -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

No response

miaaaa0a commented 1 year ago

nevermind, it wasnt specified in the docs that you can actually set a background for the label-occupied label, but it is possible