Qtile swallow.
This commit is contained in:
parent
9a111ac692
commit
afdf3d4bcd
1 changed files with 23 additions and 6 deletions
|
@ -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.config import Click, Drag, DropDown, Group, Key, Match, ScratchPad, Screen
|
||||||
from libqtile.lazy import lazy
|
|
||||||
from libqtile.dgroups import simple_key_binder
|
from libqtile.dgroups import simple_key_binder
|
||||||
from libqtile.backend.wayland import InputConfig
|
from libqtile.lazy import lazy
|
||||||
|
|
||||||
groups = [
|
groups = [
|
||||||
Group("1", label="\uf292"),
|
Group("1", label="\uf292"),
|
||||||
|
@ -195,6 +195,26 @@ floating_layout = layout.Floating(
|
||||||
border_width=2,
|
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_fullscreen = True
|
||||||
auto_minimize = True
|
auto_minimize = True
|
||||||
bring_front_click = False
|
bring_front_click = False
|
||||||
|
@ -203,6 +223,3 @@ focus_on_window_activation = "smart"
|
||||||
follow_mouse_focus = True
|
follow_mouse_focus = True
|
||||||
reconfigure_screens = True
|
reconfigure_screens = True
|
||||||
wmname = "LG3D"
|
wmname = "LG3D"
|
||||||
# wl_input_rules = {
|
|
||||||
# "type:keyboard": InputConfig(kb_layout='pl'),
|
|
||||||
# }
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue