Difference between revisions of "KWin Rules Examples"

Line 24: Line 24:
 
==Display Application on all Desktops and One of Its Children Types Differently==
 
==Display Application on all Desktops and One of Its Children Types Differently==
  
Except for conversation windows, display '''Kopete''' and its children windows on all desktops and skip the systray and pager (the '''Virtual Desktop''' view in systray).  For conversation windows, treat them as the parent window except show them in systray.
+
Except for conversation windows, display '''Kopete''' and its children windows (e.g. Configuration) on all desktops and skip the systray and pager (the '''Virtual Desktop''' view in systray).  For conversation windows, treat them as the parent window except show them in systray.
  
 
In order to implement the above, two rules need to be created:
 
In order to implement the above, two rules need to be created:

Revision as of 15:56, 1 March 2012

Examples

The environment in these examples has eight Virtual Desktops.

The first example details all the steps. Subsequent examples only list steps specific to the example.

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.

The KWin rule is created as follows:

  1. Start Akregator on desktop two, size and place 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 option in the left column and click on the New... button:
    Kwin-rules-main.png
  4. The Edit Window-Specific Settings window is displayed. The Window matching tab is the default tab:
    Window-matching-init.png
  5. 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:
    Akgregator-info.png
  6. 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):
    Window-matching-ready-akregator.png
  7. Enable the window attributes: Position, Size and Desktop. The values are automatically set by Detect Window Properties:
    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.

Display Application on all Desktops and One of Its Children Types Differently

Except for conversation windows, display Kopete and its children windows (e.g. Configuration) on all desktops and skip the systray and pager (the Virtual Desktop view in systray). For conversation windows, treat them as the parent window except show them in systray.

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 (pablo - make this a link to the respective section), the Kopete Chat rule must precede Kopete rule in the KWin Rule list.

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:
    Kopete-chat-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:
    Window-matching-kopete-chat.png
  3. Enable the following attributes:
    Kopete-chat-attribute-1.png
    Kopete-chat-attribute-2.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: no skip taskbar or do not skip taskbar.


Kopete Rule

Assuming Kopete is open:

  1. Use Detect Window Properties and select the Kopete window. Check the Secondary class name box to include all of Kopetes children windows:
    Kopete-info.png
  2. Clicking OK in the previous window back-fills the results in the Window Matching tab. Enter a meaningful Description:
    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.

KWin Rule List

As mentioned above, the Kopete Chat rule must precede the Kopete rule:

Kwin-kopete-rules.png

Suppress a Window showing on Pager

Good for knotes

Force a Window to the Top

Multiple Rules per Application

e.g. Thunderbird on one desktop and composition window on any

Pop Active Window to the Front/Top


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