class XDo::Search
- XDo::Search
- Reference
- Object
Overview
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.
Defined in:
x_do/search.crConstructors
Class Method Summary
Instance Method Summary
- 
        #desktop(desktop)
        
          Search for windows on desktop. 
- 
        #limit(limit)
        
          Limit the number of results returned. 
- #mask : SearchMask
- 
        #max_depth(depth)
        
          Limit search to a depth of depth. 
- 
        #only_visible
        
          Search only for windows that are currently visible. 
- 
        #pid(pid)
        
          Search for windows whose ( _NET_WM_PID) are pid.
- 
        #require_all
        
          Require all criteria to be met, not just one. 
- 
        #screen(screen)
        
          Search for windows on screen. 
- 
        #to_struct
        
          Converts the instance into a struct compatible with libxdo.
- 
        #window_class(str : String)
        
          Search for windows whose class are str. 
- 
        #window_class_name(str : String)
        
          Search for windows whose class name are str. 
- 
        #window_name(str : String)
        
          Search for windows whose names are str. 
Constructor Detail
Class Method Detail
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
endInstance Method Detail
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.
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).
Converts the instance into a struct compatible with libxdo.
NOTE You should never have to interact with this method directly.