KWin Rules Examples: Difference between revisions

From KDE UserBase Wiki
Line 3: Line 3:
{{Note|The first example details all the necessary steps to create the rules.  In order to keep this page a manageable size, subsequent examples only list steps specific to the example.}}
{{Note|The first example details all the necessary steps to create the rules.  In order to keep this page a manageable size, subsequent examples only list steps specific to the example.}}


{{Note|The '''Pager''' attribute refers to the '''Virtual Desktop Manager''':
{{Note|The '''Pager''' attribute refers to the '''Virtual Desktop Manager''':<br><br>
[[Image:pager-4-desktops.png|center]]}}
[[Image:pager-4-desktops.png|center]]}}


Line 12: Line 12:
The '''KWin''' rule is created as follows:
The '''KWin''' rule is created as follows:


# Start '''Akregator''' on ''desktop two'', size and position it to suit:[[Image:akregator-fav.png|350px|center]]
# Start '''Akregator''' on ''desktop two'', size and position it to suit:<br><br>
# Right-click on the menu bar and select '''Configure Window Behavior...''':[[Image:config-win-behavior.png|center]]
[[Image:akregator-fav.png|350px|center]]
# Select the '''Window Rules''' option in the left column and click on the '''New...''' button:[[Image:kwin-rules-main.png|350px|center]]
# Right-click on the menu bar and select '''Configure Window Behavior...''':<br><br>
# The '''Edit Window-Specific Settings''' window is displayed.  The '''Window matching''' tab is the default tab:[[Image:window-matching-init.png|350px|center]]
[[Image:config-win-behavior.png|center]]
# Click on '''Detect Window Properties''' and with '''0s delay''' the cursor immediately turns into cross-hairs.  Click (anywhere) inside the '''Akregator''' window (but not the title bar).  The window criteria are presented.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:akgregator-info.png|350px|center]]
# Select the '''Window Rules''' option in the left column and click on the '''New...''' button:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''' (which is displayed in the '''KWin Rule''' window):[[Image:window-matching-ready-akregator.png|350px|center]]
[[Image:kwin-rules-main.png|350px|center]]
# Enable the window attributes: '''Position''', '''Size''' and '''Desktop'''.  The initial values are set by '''Detect Window Properties''' and can be overridden:[[Image:akregator-attributes.png|350px|center]]
# The '''Edit Window-Specific Settings''' window is displayed.  The '''Window matching''' tab is the default tab:<br><br>
# Clicking '''OK''' in the previous window returns to the main '''KWin Rules'''.  The new rule with its '''Description''' is listed:[[Image:kwin-rules-main-n-akregator.png|350px|center]]
[[Image:window-matching-init.png|350px|center]]
# Click on '''Detect Window Properties''' and with '''0s delay''' the cursor immediately turns into cross-hairs.  Click (anywhere) inside the '''Akregator''' window (but not the title bar).  The window criteria are presented.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
[[Image:akgregator-info.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''' (which is displayed in the '''KWin Rule''' window):<br><br>
[[Image:window-matching-ready-akregator.png|350px|center]]
# Enable the window attributes: '''Position''', '''Size''' and '''Desktop'''.  The initial values are set by '''Detect Window Properties''' and can be overridden:<br><br>
[[Image:akregator-attributes.png|350px|center]]
# Clicking '''OK''' in the previous window returns to the main '''KWin Rules'''.  The new rule with its '''Description''' is listed:<br><br>
[[Image:kwin-rules-main-n-akregator.png|350px|center]]
# Click '''OK''' to close the window.
# Click '''OK''' to close the window.
# Done.
# Done.
Line 39: Line 47:
Assuming a '''Kopete Chat''' window is open:
Assuming a '''Kopete Chat''' window is open:


# Use '''Detect Window Properties''' and select the '''Kopete  Chat''' window.  Check the '''Window role''' box to restrict the criteria to chat windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:kopete-chat-info.png|350px|center]]
# Use '''Detect Window Properties''' and select the '''Kopete  Chat''' window.  Check the '''Window role''' box to restrict the criteria to chat windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-kopete-chat.png|350px|center]]
[[Image:kopete-chat-info.png|350px|center]]
# Enable the following attributes:[[Image:kopete-chat-attribute-1.png|350px|center]][[Image:kopete-chat-attribute-2.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-kopete-chat.png|350px|center]]
# Enable the following attributes:<br><br>
[[Image:kopete-chat-attribute-1.png|350px|center]][[Image:kopete-chat-attribute-2.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.
{{Note|The '''Skip taskbar''' attribute is set to '''No''' to display the window in the taskbar which loosely translates to:  '''no''' ''do not'' '''skip taskbar''' {{Smiley}}.}}
{{Note|The '''Skip taskbar''' attribute is set to '''No''' to display the window in the taskbar which loosely translates to:  '''no''' ''do not'' '''skip taskbar''' {{Smiley}}.}}
Line 49: Line 60:
Assuming '''Kopete''' is open:
Assuming '''Kopete''' is open:


# Use '''Detect Window Properties''' and select the '''Kopete''' window.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:kopete-info.png|350px|center]]
# Use '''Detect Window Properties''' and select the '''Kopete''' window.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-kopete.png|350px|center]]
[[Image:kopete-info.png|350px|center]]
# Enable the following attributes:[[Image:kopete-attribute-1.png|350px|center]][[Image:kopete-attribute-2.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-kopete.png|350px|center]]
# Enable the following attributes:<br><br>
[[Image:kopete-attribute-1.png|350px|center]][[Image:kopete-attribute-2.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.


===Kopete KWin Rule List===
===Kopete KWin Rule List===


As mentioned, due to [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]] processing, the '''Kopete Chat''' rule must precede the '''Kopete''' rule:[[Image:kwin-kopete-rules.png|350px|center]]
As mentioned, due to [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]] processing, the '''Kopete Chat''' rule must precede the '''Kopete''' rule:<br><br>
[[Image:kwin-kopete-rules.png|350px|center]]


==Suppress a Window from showing on Pager==
==Suppress a Window from showing on Pager==
Line 64: Line 79:
Assuming a ''sticky note''' window is available:
Assuming a ''sticky note''' window is available:


# Use '''Detect Window Properties''' and select any ''sticky note'' window.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:KNotes-info.png|350px|center]]
# Use '''Detect Window Properties''' and select any ''sticky note'' window.  Match only by '''primary class name''' so leave the check boxes unchecked - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-KNotes.png|350px|center]]
[[Image:KNotes-info.png|350px|center]]
# Enable the '''Skip Pager''' attribute with the '''Force''' the [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:[[Image:KNotes-attribute.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-KNotes.png|350px|center]]
# Enable the '''Skip Pager''' attribute with the '''Force''' the [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:<br><br>
[[Image:KNotes-attribute.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.


==Force a Window to the Top==
==Force a Window to the Top==


To pop an active window to the top, set its '''Focus stealing prevention''' attribute to '''None''', typically, in conjunction with the '''Force''' [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:[[Image:focus-stealing-pop2top-attribute.png|350px|center]]
To pop an active window to the top, set its '''Focus stealing prevention''' attribute to '''None''', typically, in conjunction with the '''Force''' [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:<br><br>
[[Image:focus-stealing-pop2top-attribute.png|350px|center]]


==Multiple Rules per Application==
==Multiple Rules per Application==
Line 87: Line 106:
Assuming the '''Thunderbird Main''' window is open, sized and position to suit:
Assuming the '''Thunderbird Main''' window is open, sized and position to suit:


# Use '''Detect Window Properties''' and select the '''Thunderbird Main''' window.  Check the '''Window role''' box to restrict the criteria to the main window - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:tbird-main-info.png|350px|center]]
# Use '''Detect Window Properties''' and select the '''Thunderbird Main''' window.  Check the '''Window role''' box to restrict the criteria to the main window - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-tbird-main.png|350px|center]]
[[Image:tbird-main-info.png|350px|center]]
# Enable the following attributes:[[Image:tbird-main-attribute.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-tbird-main.png|350px|center]]
# Enable the following attributes:<br><br>
[[Image:tbird-main-attribute.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.


Line 96: Line 118:
Assuming a '''Thunderbird Composer''' window is open:
Assuming a '''Thunderbird Composer''' window is open:


# Use '''Detect Window Properties''' and select the '''Thunderbird Compose''' window.  Check the '''Window role''' and '''Window type''' boxes to restrict the criteria to composition windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:tbird-compose-info.png|350px|center]]
# Use '''Detect Window Properties''' and select the '''Thunderbird Compose''' window.  Check the '''Window role''' and '''Window type''' boxes to restrict the criteria to composition windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-tbird-compose.png|350px|center]]
[[Image:tbird-compose-info.png|350px|center]]
# Enable the following attributes:[[Image:tbird-compose-attribute.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-tbird-compose.png|350px|center]]
# Enable the following attributes:<br><br>
[[Image:tbird-compose-attribute.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.


Line 105: Line 130:
Assuming a '''Thunderbird Reminder''' window is open:
Assuming a '''Thunderbird Reminder''' window is open:


# Use '''Detect Window Properties''' and select the '''Thunderbird Reminder''' window.  Check the '''Secondary class name''' and '''Window Type''' boxes to restrict the criteria to reminder windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:[[Image:tbird-reminder-info.png|350px|center]]
# Use '''Detect Window Properties''' and select the '''Thunderbird Reminder''' window.  Check the '''Secondary class name''' and '''Window Type''' boxes to restrict the criteria to reminder windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br><br>
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':[[Image:window-matching-tbird-reminder.png|350px|center]]
[[Image:tbird-reminder-info.png|350px|center]]
# Enable the following attributes:[[Image:tbird-reminder-attribute-1.png|350px|center]][[Image:tbird-reminder-attribute-2.png|350px|center]]
# Clicking '''OK''' in the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful '''Description''':<br><br>
[[Image:window-matching-tbird-reminder.png|350px|center]]
# Enable the following attributes:<br><br>
[[Image:tbird-reminder-attribute-1.png|350px|center]][[Image:tbird-reminder-attribute-2.png|350px|center]]
# Click through to complete entry of the rule.
# Click through to complete entry of the rule.

Revision as of 20:47, 2 March 2012

Examples

Note

The first example details all the necessary steps to create the rules. In order to keep this page a manageable size, subsequent examples only list steps specific to the example.


Note

The Pager attribute refers to the Virtual Desktop Manager:


Pin a Window to a Desktop and set other Attributes

Pin Akregator to Virtual Desktop 2. Additionally, start the application with a preferred size and position. For each attribute, use the Apply Initially parameter so it can be overridden at run-time.

The KWin rule is created as follows:

  1. Start Akregator on desktop two, size and position it to suit:

  1. Right-click on the menu bar and select Configure Window Behavior...:

  1. Select the Window Rules option in the left column and click on the New... button:

  1. The Edit Window-Specific Settings window is displayed. The Window matching tab is the default tab:

  1. Click on Detect Window Properties and with 0s delay the cursor immediately turns into cross-hairs. Click (anywhere) inside the Akregator window (but not the title bar). The window criteria are presented. Match only by primary class name so leave the check boxes unchecked - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description (which is displayed in the KWin Rule window):

  1. Enable the window attributes: Position, Size and Desktop. The initial values are set by Detect Window Properties and can be overridden:

  1. Clicking OK in the previous window returns to the main KWin Rules. The new rule with its Description is listed:

  1. Click OK to close the window.
  2. Done.

Application on all Desktops and Handle One Child Window Uniquely

Except for conversation windows, display Kopete and its children windows on all desktops and skip the systray and pager. For children conversation windows, treat them as the parent window except show them in systray.

For each attribute, use the Force parameter so it can not be overridden.

In order to implement the above, two rules need to be created:

  1. A rule for Kopete Chat and
  2. A rule for Kopete

The Kopete Chat rule's matching-criteria is more restrictive than the Kopete rule as it needs to match a specific Window Role: the chat window. Due to rule evaluation processing, the Kopete Chat rule must precede the Kopete rule in the KWin Rule list for Kopete.

Kopete Chat Rule

Assuming a Kopete Chat window is open:

  1. Use Detect Window Properties and select the Kopete Chat window. Check the Window role box to restrict the criteria to chat windows - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the following attributes:

  1. Click through to complete entry of the rule.

Note

The Skip taskbar attribute is set to No to display the window in the taskbar which loosely translates to: no do not skip taskbar .


Kopete Rule

Assuming Kopete is open:

  1. Use Detect Window Properties and select the Kopete window. Match only by primary class name so leave the check boxes unchecked - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the following attributes:

  1. Click through to complete entry of the rule.

Kopete KWin Rule List

As mentioned, due to rule evaluation processing, the Kopete Chat rule must precede the Kopete rule:

Suppress a Window from showing on Pager

KNotes currently does not allow for its notes to skip the pager however a rule easily solves this shortcoming.

Assuming a sticky note' window is available:

  1. Use Detect Window Properties and select any sticky note window. Match only by primary class name so leave the check boxes unchecked - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the Skip Pager attribute with the Force the parameter:

  1. Click through to complete entry of the rule.

Force a Window to the Top

To pop an active window to the top, set its Focus stealing prevention attribute to None, typically, in conjunction with the Force parameter:

Multiple Rules per Application

Thunderbird has several different child windows. This example:

  • Pin Thunderbird's main window on Virtual Desktop 1 with a specific size and location on the desktop.
  • Allow the Thunderbird composer window to reside on any desktop and when activated, force focus and pop it to the top of all windows.
  • Pop the Thunderbird reminder to the top and do not give it focus so it isn't inadvertently dismissed.

Each rule's matching criteria is sufficiently restrictive so their order within the main KWin window is not important to affect rule evaluation.

Thunderbird - Main

Assuming the Thunderbird Main window is open, sized and position to suit:

  1. Use Detect Window Properties and select the Thunderbird Main window. Check the Window role box to restrict the criteria to the main window - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the following attributes:

  1. Click through to complete entry of the rule.

Thunderbird - Composer

Assuming a Thunderbird Composer window is open:

  1. Use Detect Window Properties and select the Thunderbird Compose window. Check the Window role and Window type boxes to restrict the criteria to composition windows - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the following attributes:

  1. Click through to complete entry of the rule.

Thunderbird - Reminder

Assuming a Thunderbird Reminder window is open:

  1. Use Detect Window Properties and select the Thunderbird Reminder window. Check the Secondary class name and Window Type boxes to restrict the criteria to reminder windows - for additional information see window matching:

  1. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:

  1. Enable the following attributes:

  1. Click through to complete entry of the rule.