KWin Rules Window Matching: Difference between revisions

From KDE Wiki Sandbox
mNo edit summary
Line 5: Line 5:
[[Image:kwin-window-matching.png|350px|center]]
[[Image:kwin-window-matching.png|350px|center]]


The <menuchoice>Window Matching</menuchoice> tab provides a series of matching-criteria fields used to identify application windows:
The <menuchoice>Window Matching</menuchoice> tab is used to specify the criteria '''KWin''' uses to evaluate whether the rule is applicable for a given window.


* <menuchoice>Window class (application)</menuchoice> - match this window and all its children windows.
Zero (match any window) or more of the following may be specified:
** and <menuchoice>Match whole window class</menuchoice>
 
* <menuchoice>Window class (application)</menuchoice> - match this window.
** and <menuchoice>Match whole window class</menuchoice> - ...  and all its children windows.
* <menuchoice>Window role</menuchoice> - restrict the match to the function of the window (e.g. a ''main window'', a ''chat window'', etc.)
* <menuchoice>Window role</menuchoice> - restrict the match to the function of the window (e.g. a ''main window'', a ''chat window'', etc.)
* <menuchoice>Window types</menuchoice> - restrict the match to the type of window:  '''Normal Window''', '''Dialog Window''', etc.
* <menuchoice>Window types</menuchoice> - restrict the match to the type of window:  '''Normal Window''', '''Dialog Window''', etc.
Line 18: Line 20:
For each field, the following operators can be applied against the field value:
For each field, the following operators can be applied against the field value:


* <menuchoice>Unimportant</menuchoice>
* <menuchoice>Unimportant</menuchoice> - ignore the field.
* <menuchoice>Exact Match</menuchoice> - case insensitive.
* <menuchoice>Exact Match</menuchoice> - case insensitive.
* <menuchoice>Substring Match</menuchoice>
* <menuchoice>Substring Match</menuchoice> - case insensitive.
* <menuchoice>Regular Expression</menuchoice> - Qt's regular expressions are implemented.  For additional information, web search ''qt regex nokia''.
* <menuchoice>Regular Expression</menuchoice> - Qt's regular expressions are implemented.  For additional information, web search ''qt regex nokia''.


Line 32: Line 34:
# Next, in the <menuchoice>Window matching</menuchoice> tab, set the number of seconds of delay before the <menuchoice>Detect Window Properties</menuchoice> function starts.  The default is zero seconds.
# Next, in the <menuchoice>Window matching</menuchoice> tab, set the number of seconds of delay before the <menuchoice>Detect Window Properties</menuchoice> function starts.  The default is zero seconds.
# Click on <menuchoice>Detect Window Properties</menuchoice> and  
# Click on <menuchoice>Detect Window Properties</menuchoice> and  
# When the mouse-cursor turns to cross-hairs, place it inside the application window and left-click.
# When the mouse-cursor turns to cross-hairs, place it inside the application window (not the title bar) and left-click.
# A new window is presented with information about the selected window:
# A new window is presented with information about the selected window.  Select the desired fields:
#* '''Class'''
#* '''Secondary class name'''
#* '''Role'''
#* '''Window role'''
#* '''Type'''
#* '''Window type'''
#* '''Title'''
#* '''Window title'''
#* '''Machine (hostname)'''


Click the <menuchoice>OK</menuchoice> button to back-fill the <menuchoice>Window Matching</menuchoice> criteria.
Click the <menuchoice>OK</menuchoice> button to back-fill the <menuchoice>Window Matching</menuchoice> criteria.


By using a combination of the information, you can tailor whether a rule applies to an entire application (by '''Class''') or a to a specific window '''Type''' within the '''Class''' - say a '''Toolbar'''.
By using a combination of the information, a rule can apply to an entire application (by '''Class''') or a to a specific window '''Type''' within the '''Class''' - say a '''Toolbar'''.

Revision as of 17:26, 2 March 2012

Window Matching

The Window Matching tab is used to specify the criteria KWin uses to evaluate whether the rule is applicable for a given window.

Zero (match any window) or more of the following may be specified:

  • Window class (application) - match this window.
    • and Match whole window class - ... and all its children windows.
  • Window role - restrict the match to the function of the window (e.g. a main window, a chat window, etc.)
  • Window types - restrict the match to the type of window: Normal Window, Dialog Window, etc.
  • Window title - restrict the match to the title of the window.
  • Machine (hostname) - restrict the match to the host name associated with the window.
Tip
While it's possible to manually enter the above information, the preferred method is to use the Detect Window Properties button.


For each field, the following operators can be applied against the field value:

  • Unimportant - ignore the field.
  • Exact Match - case insensitive.
  • Substring Match - case insensitive.
  • Regular Expression - Qt's regular expressions are implemented. For additional information, web search qt regex nokia.

Detect Window Properties

The Detect Window Properties function simplifies the process of entering the matching-criteria.

  1. For the application you'd like to create a rule, start the application.
  2. Next, in the Window matching tab, set the number of seconds of delay before the Detect Window Properties function starts. The default is zero seconds.
  3. Click on Detect Window Properties and
  4. When the mouse-cursor turns to cross-hairs, place it inside the application window (not the title bar) and left-click.
  5. A new window is presented with information about the selected window. Select the desired fields:
    • Secondary class name
    • Window role
    • Window type
    • Window title

Click the OK button to back-fill the Window Matching criteria.

By using a combination of the information, a rule can apply to an entire application (by Class) or a to a specific window Type within the Class - say a Toolbar.