Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7.1 bars under 100% width will have repeating empty bars next to the working bars that have output #3060

Open
5 tasks done
Xt3ns1s opened this issue Dec 17, 2023 · 3 comments

Comments

@Xt3ns1s
Copy link

Xt3ns1s commented Dec 17, 2023

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

Have a bar under 100% width on the far left side of the screen.

Minimal config

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

[colors]
background = #282A2E 
background-alt = #373B41
foreground = #C5C8C6
primary = #FF6D10
secondary = #FF6A13
alert = #A54242
disabled = #707880
spotify-black = #91414 
spotify-green = #1DB954
transparent-black = #aa000000
blue = #0064ff

[bar/bar1]
	width = 100%
	height = 22pt
	radius = 10
	background = #aa000000
	foreground = ${colors.foreground}
	line-size = 2pt
	border-size = 4pt
	module-margin = 1
	padding-right = 1
	padding-left = 1

	font-0 = monospace;2
	font-1 = Symbols Nerd Font:style=2048-em

	modules-left = xworkspaces xwindow 
	modules-right = spotify filesystem pulseaudio memory cpu cpu-temp wlan tray rofi-power-menu
	cursor-click = pointer
	cursor-scroll = ns-resize
	enable-ipc = true
	wm-restack = i3

[bar/vol-bar]
	width = 12%
	height = 20pt
	radius = 10 
	background = #aa000000
	foreground = #C5C8C6
	border-size = 2pt
	border-color = #FF6D10
	module-margin = 1

	monitor = DisplayPort-1

	font-0 = Square721 BT:style=Roman
	font-1 = Symbols Nerd Font:style=2048-em	
	
	modules-center = pulseaudio headset-plug-status headset-batt

	cursor-click = pointer
	cursor-scroll = ns-resize
	enable-ipc = true
	wm-restack = i3

[bar/mouse-bar]
	width = 15%
	height = 20pt
	radius = 10
	background = #aa000000
	foreground = #C5C8C6
	border-size = 2pt
	border-color = #0064ff

	module-margin = 1

	monitor = DisplayPort-1

	font-0 = Square721 BT:style=Roman
	font-1 = Symbols Nerd Font:style=2048-em	
	
	modules-center = logi-dpi-dis logi-mouse-batt-per

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

	enable-ipc = true
	wm-restack = i3
	bottom = true

[bar/spotify-bar] 
	width = 20%
	height = 20pt
	radius = 10 
	offset-x = 15%

	background = #aa013220
	foreground = ${colors.spotify-green}

	border-size = 2pt
	border-color = ${colors.spotify-green}
	padding-left = 0
	padding-right = 0

	font-0 = monospace;2
	font-1 = Symbols Nerd Font:style=2048-em

	modules-center = spotify
	
	cursor-click = pointer
	cursor-scroll = ns-resize

	enable-ipc = true

	override-redirect = true

	bottom = true

[bar/bottom-bar]
	width = 20%
	height = 20pt
	radius = 10 

	background = #aaA54242
	foreground = #C5C8C6

	border-size = 2pt
	border-color = #FF6D10
	module-margin = 1

	font-1 = Square721 BT:style=Roman
	font-0 = Borda,Borda 4:style=Regular 9,Regular
	font-2 = Symbols Nerd Font:style=2048-em	

	modules-center = date outside-temp gas-price

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

	enable-ipc = true
	bottom = true


[module/tray]
type = internal/tray
format-margin = 8px
tray-spacing = 8px

[module/headset-batt]
type = custom/script
exec = /home/xt3ns1s/.config/polybar/poly-scripts/headset-batt.sh
internal = 1
format-prefix = ""
label = "%output%"
format-prefix-foreground = ${colors.primary}

[module/headset-plug-status]
type = custom/script
exec = /home/xt3ns1s/.config/polybar/poly-scripts/headsetplugstatus.sh 
internal = 1
format-prefix = "󰕓 "
label = "%output%"
format-prefix-foreground = ${colors.primary}

[module/logi-mouse-reports-stream]
type = custom/script
exec = python ~/Documents/mouse-reports-stream.py
internal = 1
format-prefix = "󰍽 "
label = "%output%"
format-prefix-foreground = ${colors.blue}
tail = true

[module/logi-mouse-batt-per]
type = custom/script
exec = /home/xt3ns1s/Documents/logi_mouse_batt_per.sh
internal = 1
format-prefix = "󰁹 "
format-fail = "%output%"
format-prefix-foreground = ${colors.blue}
tail = true

[module/logi-dpi-dis]
type = custom/script
exec = python ~/Documents/logitech_mouse_dpi_notify.py
internal = 1
format-prefix = ""
label = "%output%"
format-prefix-foreground = #0064ff
tail = true

[module/outside-temp]
type = custom/script
exec = python ~/.config/polybar/scripts/weather.py
interval = 5
format-prefix = ""
format-prefix-foreground = ${colors.primary}
label-foreground = ${colors.primary}
label = "%output%"

[module/timer]
type = custom/script
interval = 1
format-prefix = 󱎫
format = <label>
exec = termdown >> 
click-left = termdown --no-figlet
format-prefix-foreground = ${colors.primary}
label = "%output%"

[module/rofi-power-menu]
type = custom/text
content = 
content-background = #000
content-foreground = #FF2400
click-left = exec rofi -show power-menu -modi power-menu:rofi-power-menu

[module/gas-price]
type = custom/script
exec = python ~/.config/polybar/poly-scripts/gas.py
interval = 2
format-prefix = "󰊘 "
format-prefix-foreground = ${colors.primary}
label-foreground = ${colors.primary}
label = "%output%"

[module/spotify]
type = custom/script
interval = 1
format-prefix = ""
format = <label>
exec = /home/xt3ns1s/.config/polybar/polybar-spotify/spotify_status.py -f '{play_pause} {song} - {artist}'
format-underline = #1db954
;control players (optional)
click-left = playerctl --player=spotify play-pause 
click-right = playerctl --player=spotify next 
click-middle = playerctl --player=spotify previous 

[module/spotify-scroll]
type = custom/script
tail = true
interval = 1
; prefix symbol is shown before the text
format-prefix = ""
format = <label>
exec = ~/.config/polybar/scripts/scroll_spotify_status.sh

[module/cpu-temp]
type = custom/script
exec = ~/.config/polybar/scripts/cpu-temp.sh
interval = 2
format-prefix = "󰏈 "  
format-prefix-foreground = ${colors.primary}
label = "%output%"

[module/info-cava]
type = custom/script
exec = ~/.config/polybar/scripts/info-cava.py -f 24 -b 12 -e fffdfc,fffafe,ffeafa,ffc3d2 -c average
tail = true

[module/xworkspaces]
type = internal/xworkspaces

label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
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

[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%

[module/filesystem]
type = internal/fs
interval = 25

mount-0 = /
label-mounted =%{F#FF6D10}󱛟  %{F#C5C8C6}%percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}

[module/pulseaudio]
type = internal/pulseaudio

sink = alsa_output.usb-SteelSeries_SteelSeries_Arctis_7-00.stereo-game

format-volume-prefix = "󰋎 "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>

label-volume = %percentage%%

label-muted = muted
label-muted-foreground = ${colors.disabled}
click-right = pavucontrol

[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock

label-layout = %layout%
label-layout-foreground = ${colors.primary}

label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}

[module/memory]
type = internal/memory
interval = 2
format-prefix ="󰍛 "  
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%

[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "󰻠 " 
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%

[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#800000}%ifname%%{F#707880} disconnected

[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#FF6A13}%ifname% %{F#C5C8C6}%essid% %local_ip%

[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%

[module/date]
type = internal/date
interval = 1
date = %Y-%m-%d %a   %I:%M:%S %p
label =  %date% 
label-foreground = ${colors.primary}

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

; vim:ft=dosini

Polybar log

# Bright orange bar, bottom left of right screen: 
[xt3ns1s@acid-byte ~] $polybar bottom-bar 
notice: Parsing config file: /home/xt3ns1s/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 1155065)
notice: Loading module 'date' of type 'internal/date'
notice: Loading module 'outside-temp' of type 'custom/script'
notice: Loading module 'gas-price' of type 'custom/script'
notice: Loaded 3 modules
notice: Loaded font "Borda,Borda 4:style=Regular 9,Regular" (name=Borda, offset=0, file=/home/xt3ns1s/.local/share/fonts/borda.ttf)
notice: Loaded font "Square721 BT:style=Roman" (name=Square721 BT, offset=0, file=/home/xt3ns1s/.local/share/fonts/SQR721N.TTF)
notice: Loaded font "Symbols Nerd Font:style=2048-em" (name=Symbols Nerd Font, offset=0, file=/usr/share/fonts/TTF/SymbolsNerdFont-Regular.ttf)
warn: Dropping unmatched character '宅' (U+fa04) in '26.8 宅'

# Blue bar, bottom left of left screen:
[xt3ns1s@acid-byte ~]$ polybar mouse-bar
notice: Parsing config file: /home/xt3ns1s/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 1214267)
notice: Loading module 'logi-dpi-dis' of type 'custom/script'
notice: Loading module 'logi-mouse-batt-per' of type 'custom/script'
notice: Loaded 2 modules
notice: Loaded font "Square721 BT:style=Roman" (name=Square721 BT, offset=0, file=/home/xt3ns1s/.local/share/fonts/SQR721N.TTF)
notice: Loaded font "Symbols Nerd Font:style=2048-em" (name=Symbols Nerd Font, offset=0, file=/usr/share/fonts/TTF/SymbolsNerdFont-Regular.ttf)                
warn: Ignoring restack of i3 window (not needed when `override-redirect = false`)

# Orange bar, top left of left screen:
[xt3ns1s@acid-byte ~]$ polybar vol-bar
notice: Parsing config file: /home/xt3ns1s/.config/polybar/config.ini
notice: Listening for IPC messages (PID: 1366284)
notice: Loading module 'pulseaudio' of type 'internal/pulseaudio'
notice: Loading module 'headset-plug-status' of type 'custom/script'
notice: Loading module 'headset-batt' of type 'custom/script'
notice: Loaded 3 modules
notice: Loaded font "Square721 BT:style=Roman" (name=Square721 BT, offset=0, file=/home/xt3ns1s/.local/share/fonts/SQR721N.TTF)
notice: Loaded font "Symbols Nerd Font:style=2048-em" (name=Symbols Nerd Font, offset=0, file=/usr/share/fonts/TTF/SymbolsNerdFont-Regular.ttf)
warn: Ignoring restack of i3 window (not needed when `override-redirect = false`)

Expected behavior

I want the bars under 100% width to only display once with output and to have no extra bars next to them. Only my desktop should be visible in the space that the empty bars are occupying. This screenshot is with polybar 3.6.3

Screenshot from 2023-12-16 19-38-46

Actual behavior

My under 100% width bars have empty bars repeating next to the bars that have output.
This screenshot is with 3.7.1

Screenshot from 2023-12-16 18-38-34

Window Manager and Version

i3 version 4.23

Linux Distribution

Linux 6.6.3-arch1-1

Polybar version

polybar 3.7.1

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 -Wdeprecated-copy-dtor -Wsuggest-override
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override  -Wall -Wextra -Wpedantic -Wdeprecated-copy-dtor -Wsuggest-override

Additional Context / Screenshots

No response

@Xt3ns1s Xt3ns1s changed the title 3.7.0 bars under 100% width will have repeating empty bars next to the working bars that have output 3.7.1 bars under 100% width will have repeating empty bars next to the working bars that have output Dec 17, 2023
@patrick96 patrick96 added this to the 3.7.2 milestone Jan 16, 2024
@patrick96
Copy link
Member

Clarifying question: Are you using a compositor in these screenshots?

I have narrowed it down to d743a22 triggering this issue.
The problem is that we just don't interact too well with i3. i3 doesn't actually let you have non-full-width bars, when putting the window on screen it tells polybar that it has the full screen width (instead of the requested width), polybar just ignores that info.

The rendering changes in that commit normally wouldn't have an effect, but because polybar treats its window smaller than it is. The contents of the first rendering get duplicated to fill out the remainder of the window.

patrick96 added a commit to patrick96/polybar that referenced this issue Feb 11, 2024
Without override-redirect, i3 will not allow you to have a
non-full-width bar. But polybar simply ignores that request and
continues to render the user-requested width instead of the width i3 has
configured the window to be.

With the 3.7 release, we started setting the window's backing pixmap to
the rendering pixmap. In the case above, the pixmap would only be
allocted for the smaller width and when i3 maps the window, it repeats
the backing pixmap to fill the entire window.

At the point where i3 maps the window, the pixmap contains an initial
render of the bar without module content and that render is then
duplicated.

Reverting back to the old approach of simply copying over the pixmap
after each render does not have that problem and the remainder of the
bar is black (or fully transparent with a compositor).

Fixes polybar#3060
patrick96 added a commit to patrick96/polybar that referenced this issue Feb 11, 2024
Without override-redirect, i3 will not allow you to have a
non-full-width bar. But polybar simply ignores that request and
continues to render the user-requested width instead of the width i3 has
configured the window to be.

With the 3.7 release, we started setting the window's backing pixmap to
the rendering pixmap. In the case above, the pixmap would only be
allocted for the smaller width and when i3 maps the window, it repeats
the backing pixmap to fill the entire window.

At the point where i3 maps the window, the pixmap contains an initial
render of the bar without module content and that render is then
duplicated.

Reverting back to the old approach of simply copying over the pixmap
after each render does not have that problem and the remainder of the
bar is black (or fully transparent with a compositor).

Ideally, polybar would respect the width i3 configures for it, but that
would break many existing setups that rely on non-full-width bars in i3

Fixes polybar#3060
@patrick96
Copy link
Member

I reverted the rendering change in #3091. Please try it out to see if it fixes your issue (it did work for me)

patrick96 added a commit that referenced this issue Feb 18, 2024
Without override-redirect, i3 will not allow you to have a
non-full-width bar. But polybar simply ignores that request and
continues to render the user-requested width instead of the width i3 has
configured the window to be.

With the 3.7 release, we started setting the window's backing pixmap to
the rendering pixmap. In the case above, the pixmap would only be
allocted for the smaller width and when i3 maps the window, it repeats
the backing pixmap to fill the entire window.

At the point where i3 maps the window, the pixmap contains an initial
render of the bar without module content and that render is then
duplicated.

Reverting back to the old approach of simply copying over the pixmap
after each render does not have that problem and the remainder of the
bar is black (or fully transparent with a compositor).

Ideally, polybar would respect the width i3 configures for it, but that
would break many existing setups that rely on non-full-width bars in i3

Fixes #3060
@Xt3ns1s
Copy link
Author

Xt3ns1s commented Jun 4, 2024

Hey, sorry to respond so late to this but yes I was using a compositor (picom) when I had this issue happen to me. I'll update polybar when I get a chance and I'll let you know if it resolved my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants