Difference between revisions of "KWin Rules Examples"

(formatting changes)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=Examples=
+
<languages />
 +
<translate>
  
 +
==Examples== <!--T:1-->
 +
 +
<!--T:2-->
 
{{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''':<br><br>[[Image:pager-4-desktops.png|center]]}}
+
<!--T:3-->
 +
{{Note|The '''Pager''' attribute refers to the '''Virtual Desktop Manager''':<br /><br />[[Image:pager-4-desktops.png|center]]}}
  
==Pin a Window to a Desktop and set other Attributes==
+
</translate><span id="Pin_a_Window_to_a_Desktop_and_set_other_Attributes"></span><translate>
  
 +
===Pin a Window to a Desktop and set other Attributes=== <!--T:4-->
 +
 +
<!--T:5-->
 
Pin '''Akregator''' to ''Virtual Desktop 2''.  Additionally, start the application with a preferred size and position.  For each attribute, use the '''Apply Initially''' [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]] so it can be overridden at run-time.
 
Pin '''Akregator''' to ''Virtual Desktop 2''.  Additionally, start the application with a preferred size and position.  For each attribute, use the '''Apply Initially''' [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]] so it can be overridden at run-time.
  
 +
<!--T:6-->
 
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:<br><br>[[Image:akregator-fav.png|350px|center]]
+
<!--T:7-->
# Right-click on the menu bar and select '''Configure Window Behavior...''':<br><br>[[Image:config-win-behavior.png|center]]
+
# Start '''Akregator''' on ''desktop two'', size and position it to suit:<br /><br />[[Image:akregator-fav.png|350px|center]]</translate>
# Select the '''Window Rules''' option in the left column and click on the '''New...''' button:<br><br>[[Image:kwin-rules-main.png|350px|center]]
+
<translate>
# The '''Edit Window-Specific Settings''' window is displayed.  The '''Window matching''' tab is the default tab:<br><br>[[Image:window-matching-init.png|350px|center]]
+
<!--T:8-->
# 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]]
+
# Right-click on the menu bar and select <menuchoice>Configure Window Behavior...</menuchoice>:<br /><br />[[Image:config-win-behavior.png|center]]</translate>
# 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]]
+
<translate>
# 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]]
+
<!--T:9-->
# 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]]
+
# Select the <menuchoice>Window Rules</menuchoice> in the left column and click on <menuchoice>New...</menuchoice>:<br /><br />[[Image:kwin-rules-main.png|350px|center]]</translate>
# Click '''OK''' to close the window.
+
<translate>
 +
<!--T:10-->
 +
# The '''Edit Window-Specific Settings''' window is displayed.  <menuchoice>Window matching</menuchoice> is the default tab:<br /><br />[[Image:window-matching-init.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:11-->
 +
# Click <menuchoice>Detect Window Properties</menuchoice> 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]]</translate>
 +
<translate>
 +
<!--T:12-->
 +
# Clicking <menuchoice>OK</menuchoice> the previous window back-fills the results in the '''Window Matching''' tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> field (which is displayed in the '''KWin Rule''' window):<br /><br />[[Image:window-matching-ready-akregator.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:13-->
 +
# Enable the window attributes: <menuchoice>Position</menuchoice>, <menuchoice>Size</menuchoice> and <menuchoice>Desktop</menuchoice>.  The initial values are set by <menuchoice>Detect Window Properties</menuchoice> and can be overridden:<br /><br />[[Image:akregator-attributes.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:14-->
 +
# Clicking <menuchoice>OK</menuchoice> 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]]</translate>
 +
<translate>
 +
<!--T:15-->
 +
# Click <menuchoice>OK</menuchoice> to close the window.</translate>
 +
<translate>
 +
<!--T:16-->
 
# Done.
 
# Done.
  
==Application on all Desktops and Handle One Child Window Uniquely==
+
</translate><span id="Application_on_all_Desktops_and_Handle_One_Child_Window_Uniquely"></span><translate>
  
 +
===Application on all Desktops and Handle One Child Window Uniquely=== <!--T:17-->
 +
 +
<!--T:18-->
 
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.
 
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''' [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]] so it can not be overridden.
+
<!--T:19-->
 +
For each attribute, use the <menuchoice>Force</menuchoice> [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]] so it can not be overridden.
  
 +
<!--T:20-->
 
In order to implement the above, two rules need to be created:
 
In order to implement the above, two rules need to be created:
# A rule for ''Kopete Chat'' and
 
# 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 [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]] processing, the '''Kopete Chat''' rule must precede the '''Kopete''' rule in the [[Special:myLanguage/KWin_Rules_Examples#Kopete KWin Rule List|'''KWin Rule''' list for '''Kopete'''.]]
+
<!--T:21-->
 +
# A rule for '''Kopete Chat''' and</translate>
 +
<translate>
 +
<!--T:22-->
 +
# A rule for '''Kopete'''
  
===Kopete Chat Rule===
+
<!--T:23-->
 +
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 [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]] processing, the '''Kopete Chat''' rule must precede the '''Kopete''' rule in the [[Special:myLanguage/KWin_Rules_Examples#Kopete KWin Rule List|KWin Rule list for Kopete]].
  
 +
</translate><span id="Kopete_Chat_Rule"></span><translate>
 +
 +
====Kopete Chat Rule==== <!--T:24-->
 +
 +
<!--T:25-->
 
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]]:<br><br>[[Image:kopete-chat-info.png|350px|center]]
+
<!--T:26-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> and select the '''Kopete  Chat''' window.  Check the <menuchoice>Window role</menuchoice> box to restrict the criteria to chat windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br /><br />[[Image:kopete-chat-info.png|350px|center]]</translate>
# Enable the following attributes:<br><br>[[Image:kopete-chat-attribute.png|350px|center]]
+
<translate>
 +
<!--T:27-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-kopete-chat.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:28-->
 +
# Enable the following attributes:<br /><br />[[Image:kopete-chat-attribute.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:29-->
 
# 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}}.}}
 
  
===Kopete Rule===
+
<!--T:30-->
 +
{{Note|The <menuchoice>Skip taskbar</menuchoice> attribute is set to <menuchoice>No</menuchoice> to display the window in the taskbar which loosely translates to:  ''no'' ''do not'' ''skip taskbar'' {{Smiley}}.}}
  
 +
</translate><span id="Kopete_Rule"></span><translate>
 +
 +
====Kopete Rule==== <!--T:31-->
 +
 +
<!--T:32-->
 
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]]:<br><br>[[Image:kopete-info.png|350px|center]]
+
<!--T:33-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> 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 />[[Image:kopete-info.png|350px|center]]</translate>
# Enable the following attributes:<br><br>[[Image:kopete-attribute-1.png|350px|center]]<br>[[Image:kopete-attribute-2.png|350px|center]]
+
<translate>
 +
<!--T:34-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-kopete.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:35-->
 +
# Enable the following attributes:<br /><br />[[Image:kopete-attribute-1.png|350px|center]]<br />[[Image:kopete-attribute-2.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:36-->
 
# Click through to complete entry of the rule.
 
# Click through to complete entry of the rule.
  
===Kopete KWin Rule List===
+
</translate><span id="Kopete_KWin_Rule_List"></span><translate>
 +
 
 +
====Kopete KWin Rule List==== <!--T:37-->
 +
 
 +
<!--T:38-->
 +
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]]
  
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]]
+
</translate><span id="Suppress_a_Window_from_showing_on_Pager"></span><translate>
  
==Suppress a Window from showing on Pager==
+
===Suppress a Window from showing on Pager=== <!--T:39-->
  
 +
<!--T:40-->
 
'''KNotes''' currently does not allow for its notes to skip the pager however a rule easily solves this shortcoming.
 
'''KNotes''' currently does not allow for its notes to skip the pager however a rule easily solves this shortcoming.
  
 +
<!--T:41-->
 
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]]:<br><br>[[Image:KNotes-info.png|350px|center]]
+
<!--T:42-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> 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 />[[Image:KNotes-info.png|350px|center]]</translate>
# 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]]
+
<translate>
 +
<!--T:43-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-KNotes.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:44-->
 +
# Enable the <menuchoice>Skip Pager</menuchoice> attribute with the <menuchoice>Force</menuchoice> [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:<br /><br />[[Image:KNotes-attribute.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:45-->
 
# Click through to complete entry of the rule.
 
# Click through to complete entry of the rule.
  
==Force a Window to the Top==
+
</translate><span id="Force_a_Window_to_the_Top"></span><translate>
 +
 
 +
===Force a Window to the Top=== <!--T:46-->
  
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]]
+
<!--T:47-->
 +
To pop an active window to the top, set its <menuchoice>Focus stealing prevention</menuchoice> attribute to <menuchoice>None</menuchoice>, typically, in conjunction with the <menuchoice>Force</menuchoice> [[Special:myLanguage/KWin_Rules_Window_Attributes#Parameters|parameter]]:<br /><br />[[Image:focus-stealing-pop2top-attribute.png|350px|center]]
  
==Multiple Rules per Application==
+
</translate><span id="Multiple_Rules_per_Application"></span><translate>
  
 +
===Multiple Rules per Application=== <!--T:48-->
 +
 +
<!--T:49-->
 
'''Thunderbird''' has several different child windows.  This example:
 
'''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.
+
<!--T:50-->
 +
* Pin '''Thunderbird's''' main window on ''Virtual Desktop 1'' with a specific size and location on the desktop.
 +
 
 +
<!--T:51-->
 
* Allow the '''Thunderbird''' composer window to reside on any desktop and when activated, force focus and pop it to the top of all windows.
 
* Allow the '''Thunderbird''' composer window to reside on any desktop and when activated, force focus and pop it to the top of all windows.
 +
 +
<!--T:52-->
 
* Pop the '''Thunderbird''' reminder to the top and do not give it focus so it isn't inadvertently dismissed.
 
* Pop the '''Thunderbird''' reminder to the top and do not give it focus so it isn't inadvertently dismissed.
  
 +
<!--T:53-->
 
Each rule's matching criteria is sufficiently restrictive so their order within the main '''KWin''' window is not important to affect [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]].
 
Each rule's matching criteria is sufficiently restrictive so their order within the main '''KWin''' window is not important to affect [[Special:myLanguage/KWin_Rules#Rule_Evaluation|rule evaluation]].
  
===Thunderbird - Main===
+
</translate><span id="Thunderbird_-_Main"></span><translate>
  
 +
====Thunderbird - Main==== <!--T:54-->
 +
 +
<!--T:55-->
 
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]]:<br><br>[[Image:tbird-main-info.png|350px|center]]
+
<!--T:56-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> and select the '''Thunderbird Main''' window.  Check the <menuchoice>Window role</menuchoice> box to restrict the criteria to the main window - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br /><br />[[Image:tbird-main-info.png|350px|center]]</translate>
# Enable the following attributes:<br><br>[[Image:tbird-main-attribute.png|350px|center]]
+
<translate>
 +
<!--T:57-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-tbird-main.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:58-->
 +
# Enable the following attributes:<br /><br />[[Image:tbird-main-attribute.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:59-->
 
# Click through to complete entry of the rule.
 
# Click through to complete entry of the rule.
  
===Thunderbird - Composer===
+
</translate><span id="Thunderbird_-_Composer"></span><translate>
  
 +
====Thunderbird - Composer==== <!--T:60-->
 +
 +
<!--T:61-->
 
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]]:<br><br>[[Image:tbird-compose-info.png|350px|center]]
+
<!--T:62-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> and select the '''Thunderbird Compose''' window.  Check the <menuchoice>Window role</menuchoice> and <menuchoice>Window type</menuchoice> boxes to restrict the criteria to composition windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br /><br />[[Image:tbird-compose-info.png|350px|center]]</translate>
# Enable the following attributes:<br><br>[[Image:tbird-compose-attribute.png|350px|center]]
+
<translate>
 +
<!--T:63-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-tbird-compose.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:64-->
 +
# Enable the following attributes:<br /><br />[[Image:tbird-compose-attribute.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:65-->
 
# Click through to complete entry of the rule.
 
# Click through to complete entry of the rule.
  
===Thunderbird - Reminder===
+
</translate><span id="Thunderbird_-_Reminder"></span><translate>
 +
 
 +
====Thunderbird - Reminder==== <!--T:66-->
  
 +
<!--T:67-->
 
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]]:<br><br>[[Image:tbird-reminder-info.png|350px|center]]
+
<!--T:68-->
# 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]]
+
# Use <menuchoice>Detect Window Properties</menuchoice> and select the '''Thunderbird Reminder''' window.  Check the <menuchoice>Secondary class name</menuchoice> and <menuchoice>Window Type</menuchoice> boxes to restrict the criteria to reminder windows - for additional information see [[Special:myLanguage/KWin_Rules_Window_Matching|window matching]]:<br /><br />[[Image:tbird-reminder-info.png|350px|center]]</translate>
# Enable the following attributes:<br><br>[[Image:tbird-reminder-attribute-1.png|350px|center]]<br>[[Image:tbird-reminder-attribute-2.png|350px|center]]
+
<translate>
 +
<!--T:69-->
 +
# Clicking <menuchoice>OK</menuchoice> in the previous window back-fills the results in the <menuchoice>Window Matching</menuchoice> tab.  Enter a meaningful text in the <menuchoice>Description</menuchoice> box:<br /><br />[[Image:window-matching-tbird-reminder.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:70-->
 +
# Enable the following attributes:<br /><br />[[Image:tbird-reminder-attribute-1.png|350px|center]]<br />[[Image:tbird-reminder-attribute-2.png|350px|center]]</translate>
 +
<translate>
 +
<!--T:71-->
 
# Click through to complete entry of the rule.
 
# Click through to complete entry of the rule.
 +
 +
<!--T:72-->
 +
[[Category:Desktop]]
 +
[[Category:Tutorials]]
 +
 +
</translate>

Latest revision as of 10:34, 17 March 2012

Other languages:
English • ‎dansk • ‎українська

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:

Pager-4-desktops.png

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:

    Akregator-fav.png
  2. Right-click on the menu bar and select Configure Window Behavior...:

    Config-win-behavior.png
  3. Select the Window Rules in the left column and click on New...:

    Kwin-rules-main.png
  4. The Edit Window-Specific Settings window is displayed. Window matching is the default tab:

    Window-matching-init.png
  5. Click Detect Window Properties 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:

    Akgregator-info.png
  6. Clicking OK the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description field (which is displayed in the KWin Rule window):

    Window-matching-ready-akregator.png
  7. Enable the window attributes: Position, Size and Desktop. The initial values are set by Detect Window Properties and can be overridden:

    Akregator-attributes.png
  8. Clicking OK in the previous window returns to the main KWin Rules. The new rule with its description is listed:

    Kwin-rules-main-n-akregator.png
  9. Click OK to close the window.
  10. 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:

    Kopete-chat-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-kopete-chat.png
  3. Enable the following attributes:

    Kopete-chat-attribute.png
  4. 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 Face-smile.png.

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:

    Kopete-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-kopete.png
  3. Enable the following attributes:

    Kopete-attribute-1.png

    Kopete-attribute-2.png
  4. 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:

Kwin-kopete-rules.png

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:

    KNotes-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-KNotes.png
  3. Enable the Skip Pager attribute with the Force parameter:

    KNotes-attribute.png
  4. 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:

Focus-stealing-pop2top-attribute.png

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:

    Tbird-main-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-tbird-main.png
  3. Enable the following attributes:

    Tbird-main-attribute.png
  4. 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:

    Tbird-compose-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-tbird-compose.png
  3. Enable the following attributes:

    Tbird-compose-attribute.png
  4. 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:

    Tbird-reminder-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful text in the Description box:

    Window-matching-tbird-reminder.png
  3. Enable the following attributes:

    Tbird-reminder-attribute-1.png

    Tbird-reminder-attribute-2.png
  4. Click through to complete entry of the rule.

This page was last edited on 17 March 2012, at 10:34. Content is available under Creative Commons License SA 4.0 unless otherwise noted.