diff --git a/_desktop/qtile/config.py b/_desktop/qtile/config.py index bd0a2e5..c14f407 100644 --- a/_desktop/qtile/config.py +++ b/_desktop/qtile/config.py @@ -1,8 +1,8 @@ -from libqtile import bar, extension, layout, widget +import psutil +from libqtile import bar, extension, hook, layout, widget from libqtile.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen -from libqtile.lazy import lazy from libqtile.dgroups import simple_key_binder -from libqtile.backend.wayland import InputConfig +from libqtile.lazy import lazy groups = [ Group("1", label="\uf292"), @@ -195,6 +195,26 @@ floating_layout = layout.Floating( border_width=2, ) +@hook.subscribe.client_new +def _swallow(window): + pid = window.window.get_net_wm_pid() + ppid = psutil.Process(pid).ppid() + cpids = {c.window.get_net_wm_pid(): wid for wid, c in window.qtile.windows_map.items()} + for i in range(5): + # if not ppid: + # return + if ppid in cpids: + parent = window.qtile.windows_map.get(cpids[ppid]) + parent.minimized = True + window.parent = parent + return + ppid = psutil.Process(ppid).ppid() + +@hook.subscribe.client_killed +def _unswallow(window): + if hasattr(window, 'parent'): + window.parent.minimized = False + auto_fullscreen = True auto_minimize = True bring_front_click = False @@ -203,6 +223,3 @@ focus_on_window_activation = "smart" follow_mouse_focus = True reconfigure_screens = True wmname = "LG3D" -# wl_input_rules = { -# "type:keyboard": InputConfig(kb_layout='pl'), -# }