mirror of
https://github.com/GRFreire/dotfiles.git
synced 2026-01-10 04:19:38 +00:00
qtile: set rules for window swallow
This commit is contained in:
parent
37e2957a7b
commit
a5cf4c04eb
@ -390,6 +390,15 @@ def autostart():
|
|||||||
|
|
||||||
@hook.subscribe.client_new
|
@hook.subscribe.client_new
|
||||||
def swallow(window):
|
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
|
pid = window.window.get_net_wm_pid() # Window PID
|
||||||
ppid = psutil.Process(pid).ppid() # Parent 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
|
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
|
return
|
||||||
if ppid in cpids:
|
if ppid in cpids:
|
||||||
parent = window.qtile.windows_map.get(cpids[ppid])
|
parent = window.qtile.windows_map.get(cpids[ppid])
|
||||||
|
if not any(parent.match(rule) for rule in swallow_from):
|
||||||
|
return
|
||||||
parent.minimized = True
|
parent.minimized = True
|
||||||
window.parent = parent
|
window.parent = parent
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user