class

XDo::Search

Inherits Reference / Object

Represents an XDo search query.

Queries can contain multiple conditions (such as matching both a window name and a process ID), as well as impose restrictions on the number of results returned, search depth, and extent of search (e.g., limiting the search to a single screen).

See XDo#search(query) for an example of using Search objects.

Constructors

new

Create a new Search.

NOTE: New Search instances contain no query criteria.

Source

Class methods

build

Builds a Search instance via a DSL.

# find no more than 3 windows that are both visible AND have the name "Firefox"
Search.build do
  require_all
  only_visible
  window_name "Firefox"
  limit 3
end
Source

Instance methods

desktop(desktop : Int32)

Search for windows on desktop.

Source
limit(limit : Int32)

Limit the number of results returned. By default, no limit (0) is imposed.

Source
mask
Source
max_depth(depth : Int32)

Limit search to a depth of depth.

0 guarantees an empty search, 1 limits the search to toplevel windows only. By default, no limit (-1) is imposed.

Source
only_visible

Search only for windows that are currently visible.

Source
pid(pid : Int32)

Search for windows whose (_NET_WM_PID) are pid.

Source
require_all

Require all criteria to be met, not just one.

This is equivalent to requiring the AND of all conditions, rather than the OR (which is the default).

Source
screen(screen : Int32)

Search for windows on screen.

Source
to_struct

Converts the instance into a struct compatible with libxdo. NOTE: You should never have to interact with this method directly.

Source
window_class(str : String)

Search for windows whose class are str.

Source
window_class_name(str : String)

Search for windows whose class name are str.

Source
window_name(str : String)

Search for windows whose names are str.

Source