river: Allow floating based on window titles

This extends the `float-filter-add` command to allow matching on window
titles as well, using a `float-filter-add kind pattern` syntax. The
following kinds are supported:

  * `title`, which matches window titles
  * `app-id`, which matches app ids

Only exact matches are considered.

As an example following configuration floats all windows with the title
'asdf with spaces'.

    riverctl float-filter-add title 'asdf with spaces'
This commit is contained in:
Ben Fiedler
2021-08-31 21:26:17 +02:00
committed by Isaac Freund
parent e59c2a73d7
commit 546252aecf
5 changed files with 70 additions and 37 deletions

View File

@ -196,15 +196,10 @@ fn handleMap(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface: *wl
view.current.float = true;
view.pending.float = true;
view.pending.box = view.float_box;
} else {
// Make views with app_ids listed in the float filter float
if (self.xwayland_surface.class) |app_id| {
if (server.config.float_filter.contains(std.mem.span(app_id))) {
view.current.float = true;
view.pending.float = true;
view.pending.box = view.float_box;
}
}
} else if (server.config.shouldFloat(view)) {
view.current.float = true;
view.pending.float = true;
view.pending.box = view.float_box;
}
view.map() catch {