elParaguayo / qtile-extras

Somewhere to store things I create for qtile that probably won't end up in the official repo
MIT License
166 stars 21 forks source link

`RoundedCorners` border decoration not working #378

Closed ervinpopescu closed 1 month ago

ervinpopescu commented 1 month ago
2024-09-23 20:51:42,521 ERROR libqtile group.py:layout_all():L162 Exception in layout monadwide
Traceback (most recent call last):
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/group.py", line 160, in layout_all
    self.layout.layout(normal, screen_rect)
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/layout/base.py", line 61, in layout
    self.configure(i, screen_rect)
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/layout/xmonad.py", line 421, in configure
    client.place(
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/backend/wayland/xdgwindow.py", line 315, in place
    self.paint_borders(bordercolor, borderwidth)
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/backend/wayland/window.py", line 357, in paint_borders
    color_ = _rgb(color)
             ^^^^^^^^^^^
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/backend/wayland/window.py", line 73, in _rgb
    return ffi.new("float[4]", utils.rgb(color))
                               ^^^^^^^^^^^^^^^^
  File "/home/ervin/.local/lib/python3.12/site-packages/libqtile/utils.py", line 140, in rgb
    raise ValueError("Invalid RGB specifier.")
ValueError: Invalid RGB specifier.

Config:

    border_focus=RoundedCorners(),
    border_normal=RoundedCorners(),
elParaguayo commented 1 month ago

How did you import RoundedCorners? And did you restart qtile after adding this to your config?

qtile-extras runs a hook on startup to inject some code to make this work. My guess is that that hook hasn't been run.

ervinpopescu commented 1 month ago
from qtile_extras.layout.decorations.borders import RoundedCorners

Suggested by ruff since it's a private import if I follow https://qtile-extras.readthedocs.io/en/latest/manual/how_to/borders.html#border-decorations.

Same thing with:

from qtile_extras.layout.decorations import RoundedCorners

qtile-extras runs a hook on startup to inject some code to make this work. My guess is that that hook hasn't been run.

Ah, the hook slipped my mind. On Wayland, let me shutdown and start Qtile. :)

ervinpopescu commented 1 month ago

WAI. :)

Sorry for opening this so fast, will first reach out on Discord in the future.

elParaguayo commented 1 month ago

All good and nice to see people trying out these features!