I made an attempt, it moves *all* the windows with the same wm_class while travelling from group to group.

It could be simplified, because I try to be compatible with different versions. So it's ugly, but you get the idea.

It's also possible that I reinvented the wheel. For example, if the chosen window is focused, it's immediate with lazy.window.togroup(switch_group=True).


/try:  # latest 6799b6ae//
//    from libqtile.backend.base import Internal, Window//
//except ImportError:  # stable v0.17//
//    from libqtile.backend.x11.xcbq import Window//
//    from libqtile.window import Internal//
////
//
//@hook.subscribe.setgroup//
//def window_on_leash()://
//    my_wm_class = "Alacritty"    # <== user choice//
//    for w in qtile.windows_map.values()://
//        if not isinstance(w, Internal)://
//            try:  # latest //
//                w_class = w.get_wm_class()//
//            except://
//                try:  # stable v0.17.0//
//                    w_class = w.window.get_wm_class()//
//                except:  # systray//
//                    continue//
//            if w_class is None or len(w_class) == 0://
//                continue  # property not set, wayland : None or x11 : []//
//            elif len(w_class) == 1://
//                w_class = w_class[0]  # wayland [ap_id]//
//            else://
//                (w_instance, w_class) = w_class  # x11//
//            if w_class == my_wm_class://
//                w.togroup()/


--
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/f70a7884-2991-f7b1-8c6e-9062c2ab3433%40gmail.com.

Reply via email to