question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

widgets don't display on bar

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
elParaguayocommented, Nov 11, 2021

You have 2 top bar or copy paste twice?

That’s two Screens.

0reactions
sercuscommented, Nov 12, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS 14 Third-Party Widgets Not Showing Up? Here Is the Fix!
The fix is simple, if the widget is missing from the 'Add Widgets' section, run its app and check again.
Read more >
Widgets Not Working On iPhone? Here's The Fix!
An Apple experts explain why widgets are not working on your iPhone and shows you how to fix the problem using a step-by-step...
Read more >
Widgets missing on your iPhone or iPad? Find out how to fix it!
5. Allow access from the Lock Screen ... One of the most useful things about widgets in the Today View is that you...
Read more >
Why are my side bar widgets not displaying on my home page?
Side column on home page not displaying widgets I have widgets set up on my side bar, they show when I click on...
Read more >
How to Hide the News Widgets in Windows 10 and 11 - WIRED
The simplest thing to do is to disable the widget area entirely. On Windows 11 you can do this by right-clicking the taskbar,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found