You are not logged in.

#1 2021-06-17 07:26:42

AmitGold
Member
Registered: 2019-07-08
Posts: 39

[SOLVED] Mouse callbacks in Qtile bar won't work

Hi,
I've been working on my first rice in Qtile, and there's a problem that I couldn't solve.
I tried to add mouse callbacks for some of my bar widgets, but I just couldn't get it to work.

Here's the snippet for opening pavucontrol when clicking on the volume widget:

def open_pavu(qtile):
    qtile.cmd_spawn("pavucontrol")

topBar = bar.Bar([
                #  ...
                # Volume
                widget.TextBox(
                    text="墳", foreground=colors["green"], fontsize=17,
                    mouse_callbacks={
                        'Button1': open_pavu},
                    volume_app="pavucontrol"),
                widget.Volume(foreground=colors["green"],
                              mouse_callbacks={'Button1': open_pavu},),
                ],
                #  ...
                )
                #  ...

But it just doesn't work.

I tried the stable qtile release, and qtile-git from the AUR, still doesn't work.

How could I fix this?

Last edited by AmitGold (2021-06-18 11:12:04)

Offline

#2 2021-06-18 09:53:59

SzzS
Member
From: Hungary
Registered: 2020-08-14
Posts: 8

Re: [SOLVED] Mouse callbacks in Qtile bar won't work

From QTile changelog:
- mouse_callbacks no longer receives the qtile object as an argument
          (they receive no arguments); import it via `from libqtile import
          qtile` instead.

https://github.com/qtile/qtile/blob/master/CHANGELOG


SzzS
Sorry, I don't speak english well. roll

Offline

#3 2021-06-18 10:59:06

AmitGold
Member
Registered: 2019-07-08
Posts: 39

Re: [SOLVED] Mouse callbacks in Qtile bar won't work

Thank you very much!

Offline

Board footer

Powered by FluxBB