Feat: dialogue to floating windows

This commit is contained in:
Bertrand Benjamin 2021-10-31 18:10:41 +01:00
parent 4491310bba
commit c74ed2a1e3

View File

@ -27,9 +27,11 @@
from libqtile.config import Key, Screen, Group, Drag, Click, ScratchPad, DropDown from libqtile.config import Key, Screen, Group, Drag, Click, ScratchPad, DropDown
from libqtile.command import lazy from libqtile.command import lazy
from libqtile import layout, bar, widget, extension, hook from libqtile import layout, bar, widget, extension, hook
from libqtile.log_utils import logger
from os.path import expanduser from os.path import expanduser
from subprocess import call from subprocess import call
from typing import List # noqa: F401 from typing import List # noqa: F401
wmname = "???" wmname = "???"
@ -244,27 +246,15 @@ main = None
follow_mouse_focus = True follow_mouse_focus = True
bring_front_click = False bring_front_click = False
cursor_warp = False cursor_warp = False
floating_layout = layout.Floating(
float_rules=[
{"wmclass": "confirm"},
{"wmclass": "dialog"},
{"wmclass": "download"},
{"wmclass": "error"},
{"wmclass": "file_progress"},
{"wmclass": "notification"},
{"wmclass": "splash"},
{"wmclass": "toolbar"},
{"wmclass": "confirmreset"}, # gitk
{"wmclass": "makebranch"}, # gitk
{"wmclass": "maketag"}, # gitk
{"wname": "branchdialog"}, # gitk
{"wname": "pinentry"}, # GPG key password entry
{"wmclass": "ssh-askpass"}, # ssh-askpass
]
)
auto_fullscreen = True auto_fullscreen = True
focus_on_window_activation = "smart" focus_on_window_activation = "smart"
@hook.subscribe.client_new
def floating_dialogs(window):
dialog = window.window.get_wm_type() == 'dialog'
transient = window.window.get_wm_transient_for()
if dialog or transient:
window.floating = True
@hook.subscribe.startup_once @hook.subscribe.startup_once
def autostart(): def autostart():