From a5cf4c04eb67b8fff90bf7331bf7f50d897ada4e Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Date: Sun, 8 Aug 2021 20:03:07 -0300 Subject: [PATCH] qtile: set rules for window swallow --- .config/qtile/config.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.config/qtile/config.py b/.config/qtile/config.py index 5ef82de..d84637c 100644 --- a/.config/qtile/config.py +++ b/.config/qtile/config.py @@ -390,6 +390,15 @@ def autostart(): @hook.subscribe.client_new def swallow(window): + swallow_from=[ + Match(wm_class="Alacritty"), + ] + + not_swallow=[] + + if any(window.match(rule) for rule in not_swallow): + return + pid = window.window.get_net_wm_pid() # Window PID ppid = psutil.Process(pid).ppid() # Parent Window PID cpids = {c.window.get_net_wm_pid(): wid for wid, c in window.qtile.windows_map.items()} # All Windows PIDs @@ -398,6 +407,8 @@ def swallow(window): return if ppid in cpids: parent = window.qtile.windows_map.get(cpids[ppid]) + if not any(parent.match(rule) for rule in swallow_from): + return parent.minimized = True window.parent = parent return