feat(hypr): float dialog-like windows at cursor, minimum size

Add a `dialog-float` window rule to both hyprdrive and hyprlua: float any
window whose title looks like a dialog (Rename/Save/Open/Opening/Confirm/
Delete/Move/Copy/Replace/Properties/Preferences — covers file-manager rename
dialogs and Firefox "Opening <file>" download prompts), centred on the cursor
at its natural (minimum) size. Catches dialogs that carry no xdg/X11 dialog
hint and would otherwise tile; Hyprland still auto-floats the ones that do.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-07-21 20:49:04 +02:00
parent 6ef9f31dee
commit f040cac729
2 changed files with 28 additions and 0 deletions

View File

@ -103,6 +103,20 @@ hl.window_rule({
move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)",
})
-- dialogs — float any dialog-like window at its natural (minimum) size, centred on
-- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/
-- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts.
-- Hyprland already auto-floats real in-process xdg/X11 dialogs; this catches the ones
-- that tile because they carry no dialog hint, matched heuristically by title. No
-- `size`, so the natural (minimum) size is kept and the cursor-centre offsets use the
-- real window_w/h (see the filepicker note above re: move/size ordering).
hl.window_rule({
name = "dialog-float",
match = { title = "^(Rename|Save|Opening |Open |Confirm|Delete|Move|Copy|Replace|Properties|Preferences).*" },
float = true,
move = "(cursor_x-(window_w/2)) (cursor_y-(window_h/2))",
})
-- spotify floating
hl.window_rule({
name = "spotify-float",

View File

@ -104,6 +104,20 @@ hl.window_rule({
move = "(monitor_w/2 - window_w/2) (monitor_h/2 - window_h/2)",
})
-- dialogs — float any dialog-like window at its natural (minimum) size, centred on
-- the cursor: renaming dialogs, generic Save/Open/Confirm/Delete/Move/Copy/Replace/
-- Properties/Preferences dialogs, and Firefox "Opening <file>" download prompts.
-- Hyprland already auto-floats real in-process xdg/X11 dialogs; this catches the ones
-- that tile because they carry no dialog hint, matched heuristically by title. No
-- `size`, so the natural (minimum) size is kept and the cursor-centre offsets use the
-- real window_w/h (see the filepicker note above re: move/size ordering).
hl.window_rule({
name = "dialog-float",
match = { title = "^(Rename|Save|Opening |Open |Confirm|Delete|Move|Copy|Replace|Properties|Preferences).*" },
float = true,
move = "(cursor_x-(window_w/2)) (cursor_y-(window_h/2))",
})
-- spotify floating
hl.window_rule({
name = "spotify-float",