PDA

View Full Version : [HOWTO] New window matching


mikedee
February 26th, 2007, 04:03 PM
Recently there was a new window matching mechanism put into core and a plugin to extend the functionality. This information only applies to versions > 0.3.7 (from today).

Currently a lot of plugins have a list of window types (eg. Desktop, Normal, Tooltip etc) which it used to apply different effects to different windows. This was always a bit basic and has problems with certain applications which do not set these types correctly.

Now this has been extended so that you can match many more attributes. A basic match looks like this.

type=desktop

This will match all windows that are type desktop.

If you want to invert the selection you just put a ! before it, ie.

!type=desktop

This will match all windows that are NOT type desktop.

You can string different expressions together with these logical operators

| = OR
& = AND

So you could do something like this

type=desktop | type=dock

This would match your desktop or your dock (panel)

You can group expressions using brackets '(' and ')'

The core functionality has 4 different attributes that you can match against.

type - Matches the window type
state - matches window based on state, use one of modal, sticky, maxvert, maxhorz, shaded, skiptaskbar, skippager, hidden, fullscreen, above, below, demandsattention
xid - matches the id of the window (this can only be added after the window is created so will not normally be used by users).
override_redirect - Set to 1 to match override_redirect windows. This can be used to exclude firefox menus because they match this (type=Normal & override_redirect=1)

The regex plugin adds these extra matching abilities, you must have it loaded for them to work.
title - The title of the window
role - The role of the window
class - The class of the window
name - The name of the window

All of these values can use regular expressions.

Most of the plugins have now been extended to support these so you can test them out. Blur now uses this for alpha_blur so you do not need to use blurset anymore, just add the window matches to alpha_blur_match.

I think its almost done, but there may be more changes to this in the future (probably just more matching options)

More information on the mailing list here

http://lists.freedesktop.org/archives/compiz/2007-February/001448.html

karmapolice
May 13th, 2007, 11:51 PM
First I have to say thank you, it is the first time I use this feature and your howto really helped me.

I have a small problem, in the wobbly plugin I have the move_window_match key as:
(Toolbar | Menu | Utility | Dialog | Normal | Unknown) & !title=Firefox

It works pretty well but for some reason when my tab has http://www.opencompositing.org/ opened in my active tab I get a wobbly firefox.

It looks like the character between OpenCompositing and the page title breaks the match or maybe my match string should be different?

mikedee
May 14th, 2007, 02:34 AM
Did you try this?

(Toolbar | Menu | Utility | Dialog | Normal | Unknown) & !title=*Firefox

The matches are regular expressions so you can use those special characters

karmapolice
May 14th, 2007, 05:04 AM
Actually if I use your suggestion Firefox always have a wobbly effect no matter which site I visit.

I'm using the git version and I compiled it 3 days ago.

XGL + fglrx

mikedee
May 16th, 2007, 07:55 PM
I cannot reproduce the original problem. I assume you have the regex plugin loaded?

Either way, you would probably be better off matching by class if you want to exclude all firefox windows. This works for me.

(Toolbar | Menu | Utility | Dialog | Normal | Unknown) & !class=Firefox-bin

karmapolice
May 17th, 2007, 01:02 AM
That did the trick, thanks

M@
June 21st, 2007, 10:54 PM
mmm excuse me but i did not get very much these features..
how could i use them in order to set a default opacity level for the gnome-terminal?
where have i to insert the "magic" string? :lol:
tnx in advance
M@

mikedee
June 22nd, 2007, 12:04 AM
Make sure you have the regex plugin loaded and the enter the window matches in general/screen0/opacity_matches and opacity_values

Something like this in opacity matches, then set opacity_values to what you want.

class=Gnome-terminal