widgets don't display on bar
See original GitHub issueI recently installed qtile on my pc and copied the config file from my laptop. I don’t know why but I can’t see some of the widgets in the bar as “textBox”, “currentlayout”, it just appears as blank. I checked the “qtile.log” and there is a problem that comes all the time:
2021-11-10 20:22:37,342 ERROR libqtile loop.py:_handle_exception():L63 ushort format requires 0 <= number <= (0x7fff * 2 + 1) Traceback (most recent call last): File “/usr/lib/python3.9/asyncio/events.py”, line 80, in _run self._context.run(self._callback, *self._args) File “/usr/lib/python3.9/site-packages/libqtile/core/manager.py”, line 805, in f func(*args) File “/usr/lib/python3.9/site-packages/libqtile/bar.py”, line 456, in _actual_draw i.draw() File “/usr/lib/python3.9/site-packages/libqtile/widget/base.py”, line 440, in draw self.drawer.draw(offsetx=self.offsetx, width=self.width) File “/usr/lib/python3.9/site-packages/libqtile/backend/x11/drawer.py”, line 163, in draw self.qtile.core.conn.conn.core.CopyArea( # type: ignore File “/usr/lib/python3.9/site-packages/xcffib/xproto.py”, line 3034, in CopyArea buf.write(struct.pack(“=xx2xIIIhhhhHH”, src_drawable, dst_drawable, gc, src_x, src_y, dst_x, dst_y, width, height)) struct.error: ushort format requires 0 <= number <= (0x7fff * 2 + 1)
I also leave here the part of the bar from my “config.py”:
##### DEFAULT WIDGET SETTINGS #####
widget_defaults = dict(
font="Ubuntu Mono",
fontsize = 12,
padding = 2,
background=colors[1]
)
extension_defaults = widget_defaults.copy()
screens = [
Screen(
top=bar.Bar(
[
widget.TextBox(
text = "",
background = colors[0],
foreground = colors[5],
padding = 20,
fontsize = 40,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm)}
),
widget.Sep(
linewidth = 0,
padding = 6,
foreground = colors[2],
background = colors[0]
),
widget.GroupBox(
font = "Ubuntu Bold",
fontsize = 35,
margin_y = 3,
margin_x = 10,
padding_y = 5,
padding_x = 3,
borderwidth = 3,
active = colors[2],
inactive = colors[7],
rounded = False,
highlight_color = colors[1],
highlight_method = "line",
this_current_screen_border = colors[6],
this_screen_border = colors [4],
other_current_screen_border = colors[6],
other_screen_border = colors[4],
foreground = colors[2],
background = colors[0]
),
widget.Prompt(
prompt = prompt,
font = "Ubuntu Mono",
padding = 10,
foreground = colors[3],
background = colors[1]
),
widget.Sep(
linewidth = 0,
padding = 40,
foreground = colors[2],
background = colors[0]
),
widget.WindowName(
font='UbuntuMono Nerd Font',
fontsize = 19,
foreground = colors[6],
background = colors[0],
padding = 0
),
widget.TextBox(
text = '',
background = colors[0],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.NetGraph(
samples= 60,
foreground = colors[2],
background = colors[5],
font='UbuntuMono Nerd Font',
fontsize = 16,
padding = 5,
line_width=2,
border_width=1
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.Sep(
linewidth = 0,
padding = 6,
foreground = colors[0],
background = colors[4]
),
widget.CPU(
padding_x = 4,
foreground = colors[2],
background = colors[4],
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " ⟳",
padding = 2,
foreground = colors[2],
background = colors[5],
fontsize = 14
),
widget.CheckUpdates(
update_interval = 1800,
distro = "Arch_checkupdates",
display_format = "{updates} Updates",
foreground = colors[2],
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')},
background = colors[5],
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " 🖬",
foreground = colors[2],
background = colors[4],
padding = 0,
fontsize = 14
),
widget.Memory(
foreground = colors[2],
background = colors[4],
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')},
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " Vol:",
foreground = colors[2],
background = colors[5],
padding = 0,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.Volume(
foreground = colors[2],
background = colors[5],
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.CurrentLayoutIcon(
custom_icon_paths = [os.path.expanduser("~/.config/qtile/icons")],
foreground = colors[0],
background = colors[4],
padding = 0,
scale = 0.7
),
widget.CurrentLayout(
foreground = colors[2],
background = colors[4],
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.Clock(
foreground = colors[2],
background = colors[5],
format = "%A, %B %d - %H:%M ",
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[0],
padding = -16,
fontsize = 45
),
widget.Systray(
background = colors[0],
foreground = colors[4],
padding = 10,
fontsize = 50,
),
widget.Sep(
linewidth = 5,
padding = 6,
foreground = colors[0],
background = colors[0]
),
widget.Sep(
linewidth = 10,
padding = 6,
foreground = colors[0],
background = colors[0]
),
],
24,
),
),
Screen(
top=bar.Bar(
[
widget.TextBox(
text = "",
background = colors[0],
foreground = colors[5],
padding = 20,
fontsize = 40,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm)}
),
widget.Sep(
linewidth = 0,
padding = 6,
foreground = colors[2],
background = colors[0]
),
widget.GroupBox(
font = "Ubuntu Bold",
fontsize = 35,
margin_y = 3,
margin_x = 10,
padding_y = 5,
padding_x = 3,
borderwidth = 3,
active = colors[2],
inactive = colors[7],
rounded = False,
highlight_color = colors[1],
highlight_method = "line",
this_current_screen_border = colors[6],
this_screen_border = colors [4],
other_current_screen_border = colors[6],
other_screen_border = colors[4],
foreground = colors[2],
background = colors[0]
),
widget.Prompt(
prompt = prompt,
font = "Ubuntu Mono",
padding = 10,
foreground = colors[3],
background = colors[1]
),
widget.Sep(
linewidth = 0,
padding = 40,
foreground = colors[2],
background = colors[0]
),
widget.WindowName(
font='UbuntuMono Nerd Font',
fontsize = 19,
foreground = colors[6],
background = colors[0],
padding = 0
),
widget.TextBox(
text = '',
background = colors[0],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.NetGraph(
samples= 60,
foreground = colors[2],
background = colors[5],
font='UbuntuMono Nerd Font',
fontsize = 16,
padding = 5,
line_width=2,
border_width=1
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.Sep(
linewidth = 0,
padding = 6,
foreground = colors[0],
background = colors[4]
),
widget.CPU(
padding_x = 4,
foreground = colors[2],
background = colors[4],
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " ⟳",
padding = 2,
foreground = colors[2],
background = colors[5],
fontsize = 14
),
widget.CheckUpdates(
update_interval = 1800,
distro = "Arch_checkupdates",
display_format = "{updates} Updates",
foreground = colors[2],
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e sudo pacman -Syu')},
background = colors[5],
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " 🖬",
foreground = colors[2],
background = colors[4],
padding = 0,
fontsize = 14
),
widget.Memory(
foreground = colors[2],
background = colors[4],
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e htop')},
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.TextBox(
text = " Vol:",
foreground = colors[2],
background = colors[5],
padding = 0,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.Volume(
foreground = colors[2],
background = colors[5],
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[4],
padding = -16,
fontsize = 45
),
widget.CurrentLayoutIcon(
custom_icon_paths = [os.path.expanduser("~/.config/qtile/icons")],
foreground = colors[0],
background = colors[4],
padding = 0,
scale = 0.7
),
widget.CurrentLayout(
foreground = colors[2],
background = colors[4],
padding = 5,
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[4],
foreground = colors[5],
padding = -16,
fontsize = 45
),
widget.Clock(
foreground = colors[2],
background = colors[5],
format = "%A, %B %d - %H:%M ",
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.TextBox(
text = '',
background = colors[5],
foreground = colors[0],
padding = -16,
fontsize = 45
),
widget.Systray(
background = colors[0],
foreground = colors[4],
padding = 10,
fontsize = 50,
),
widget.Sep(
linewidth = 5,
padding = 6,
foreground = colors[0],
background = colors[0]
),
widget.Battery(
format='{percent:2.0%}',
charge_char = u'▲',
discharge_char = u'▼',
padding = 2,
foreground = colors[2],
background = colors[0],
font='UbuntuMono Nerd Font',
fontsize = 16,
),
widget.Sep(
linewidth = 10,
padding = 6,
foreground = colors[0],
background = colors[0]
),
],
24,
),
),
]
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
That’s two
Screen
s.Okay so I kind of fix it. I have no idea where the problem was but all I did was remove all of the “widget.Textbox” to check where the problem was, then I added just one of them but still didn’t work. Then I changed the value from it and placed a word there (in my case I just placed “aaaaa” to check, so anything works), I also removed the values of “padding” and “fontsize”, then I added them again and it worked. I have 0 idea about what the problem was, maybe it was as elParaguayo said and the problem was with the negative padding, but now I have a padding of -15 and a font size of 90 (only in those widgets), so no idea guys, if anyone gets this same problem just try to remove all of them except one and then try to change all the values and see what you get.