elParaguayo / qtile-extras

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

RectDecorations problem #360

Closed cr1ogen closed 2 months ago

cr1ogen commented 2 months ago

If I follow the guide and do this.

All widgets available from this repo can have decorations added to them.

In addition, all widgets in the main Qtile repository can also have decorations attached. To do this, you simply need to change the import in your config file, replacing:

from libqtile import widget

with:

from qtile_extras import widget

RectDecoration not working on qtile-extra widgets

My widget.py is this

import os
import subprocess
from libqtile import qtile
#from libqtile import widget
from qtile_extras import widget 
from qtile_extras.widget.decorations import RectDecoration

from modules.colors import colors

widget_defaults = dict(
    font="Mononoki Nerd Font",
    fontsize=12,
    padding=3,
)
extension_defaults = widget_defaults.copy()

decoration_group = {
    "decorations": [
        RectDecoration(colour=colors['orange'], radius=6, filled=True, padding_y=4, group=True, clip=True)
    ],
    "padding": 10,
}

primary_widgets = [
                widget.GroupBox(
                    font="Mononoki Nerd Font",
                    fontsize=16,
                    #margin=-2,
                    center_aligned=True,
                    highlight_method='text',
                    highlight_color=colors['orange'],
                    this_current_screen_border=colors['white'],
                    inactive=colors['white'],
                    **decoration_group,
                ),
                    widget.CurrentLayoutIcon(
                    scale=0.7,
                    use_mask=True,
                    foreground=colors['white'], 
                ),
                widget.TaskList(
                    font="Mononoki Nerd Font",
                    fontsize=14,
                    icon_size=20,
                    margin=3,
                    highlight_method='text',
                    foreground=colors['white'],
                    border=colors['orange'],
                    max_title_width=200,
                    theme_mode='preferred',
                    theme_path='/usr/share/icons/candy-icons', 
                ),
                widget.TextBox(
                    text='󰥔',
                    #foreground=colors['white'],
                    fontsize=18,
                    **decoration_group,
                ),    
                widget.Clock(
                    format= '%d %b, %H:%M %p',
                    font='Mononoki Nerd Font Bold',
                    fontsize=16,
                    foreground=colors['white'],
                    **decoration_group,
                ),
                widget.Spacer(
                ),
                     widget.TextBox(
                    text='󰌌',
                    fontsize=20,
                    padding=5,
                    foreground=colors['white'],
                ),
                widget.KeyboardLayout(
                configured_keyboards=['us','es'],
                foreground=colors['orange']
                ),
                    widget.StatusNotifier(
                        icon_theme='/usr/share/candy-icons',
                    icon_size=20,
                    highlight_colour=colors['orange'],
                        show_menu_icons=True,
                    **decoration_group,
                    ),
                    widget.PulseVolumeExtra(
                    mode='both',
                    theme_path='/usr/share/icons/candy-icons',
                    bar_width=50,
                    bar_height=75,
                    channel='Master',
                    icon_size=22,
                    volume_down_command='XF86AudioLowerVolume',
                    volume_up_command='XF86AudioRaiseVolume',
                    mouse_callbacks={'Button3': lambda: qtile.cmd_spawn("pavucontrol")},
                    **decoration_group,
                    #margin=13,
                ),
                widget.TextBox(
                    text='',
                    fontsize=18,
                    padding=9,
                    #margin=13,
                    mouse_callbacks={'Button1': lambda: qtile.cmd_spawn("wlogout")},
                )

]

Where the PulseVolumeExtra widget decoration does not work. 240708_22-05-50

elParaguayo commented 2 months ago

Very strange.

I'll take a look when I can but I don't have a lot of time for qtile this month.

EDIT: I just tried your config and it worked fine for me.

cr1ogen commented 2 months ago

Maybe it's something elsewhere in my setup. This is my repository with the files so you can see them without obligation, only if you have time. Thank you!! https://github.com/cr1ogen/cr1odots/tree/main/config/qtile

cr1ogen commented 2 months ago

I already solved it, putting icon mode in widget.PulseVolumeExtra. Thanks

elParaguayo commented 2 months ago

Hmm. That doesn't sound like a solution!

cr1ogen commented 2 months ago

But it worked, because I put the both option back and it was fine, I even restarted the PC and it no longer gives me that error.
240711_22-44-59 240711_22-46-51