Skip to content

Instantly share code, notes, and snippets.

@m-col
Created April 27, 2022 10:14
Show Gist options
  • Save m-col/d68cfd9cd08cc7d5ffdcde560d1ab6cb to your computer and use it in GitHub Desktop.
Save m-col/d68cfd9cd08cc7d5ffdcde560d1ab6cb to your computer and use it in GitHub Desktop.
Qtile: Make matching windows floating at a specific position
"""
Make matching windows floating at a specific position.
"""
from libqtile import config, hook
from libqtile.backend import base
# Also add this `Match` to `Floating(float_rules=...)`,
# making these windows to always start as floating.
to_position = config.Match(wm_class="GLava")
@hook.subscribe.client_managed
def _(win: base.WindowType) -> None:
if isinstance(win, base.Window): # Ignore Static windows
if win.match(to_position): # Find matching windows
win.cmd_set_position_floating(0, 0) # x, y
win.cmd_set_size_floating(600, 400) # width, height
@m-col
Copy link
Author

m-col commented Apr 28, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment