Can I exclude windows in Window Filter?

960 views
Skip to first unread message

hobbyhack

unread,
May 26, 2010, 6:00:57 PM5/26/10
to autokey-users
Is there a way to exclude windows with the Window Filter field?

I am a heavily virtualized and at any given time I have 2-3 different
guest operating systems running through Virtual Box. I can easily
identify the windows because they end in "VirtualBox OSE".

I would like to run autokey on both the guest and host operating
system and use the same abbreviations and hotkeys. A good example is
I replace adr with my phone number. When I am on my work virtual
machine computer I want it to input my work address. When I am on my
host system I want it to type my home address. Right now the host
grabs that input and sends my home address while my work machine is
changing it to my work address and the result is garbled.

Christiaan Dekter

unread,
May 26, 2010, 7:21:29 PM5/26/10
to autoke...@googlegroups.com
Yes, that is pretty much the point of the window filter. The text you enter is compiled as a regular expression, so you have pretty much unlimited power in how you want to match window names. Only window names that match the expression will cause the abbreviation to trigger.

To match in all windows except one with a certain title is a little trickier as regexes do not provide a straight-forward way of doing so. However, the following should work:

^((?!.*VirtualBox OSE).)*$

The above assumes that the window title ends on VirtualBox OSE. Any window titles that end on this will NOT trigger a match, and any that don't, will.

hobbyhack

unread,
May 26, 2010, 7:33:10 PM5/26/10
to autokey-users
Awesome! Thank you very much. This tool is amazing and has allowed
me to finally move completely to Linux.

On May 26, 7:21 pm, Christiaan Dekter <cdek...@gmail.com> wrote:
> Yes, that is pretty much the point of the window filter. The text you enter
> is compiled as a regular expression, so you have pretty much unlimited power
> in how you want to match window names. Only window names that match the
> expression will cause the abbreviation to trigger.
>
> To match in all windows except one with a certain title is a little trickier
> as regexes do not provide a straight-forward way of doing so. However, the
> following should work:
>
> ^((?!.*VirtualBox OSE).)*$
>
> The above assumes that the window title ends on VirtualBox OSE. Any window
> titles that end on this will NOT trigger a match, and any that don't, will.
>

Duns

unread,
Mar 26, 2019, 6:11:07 AM3/26/19
to autokey-users
For me not works today with LibreOffice: i tried
^((?!.*libreoffice).)*$, 
^((?!.*libreoffice.libreoffice).)*$, 
^((?!.*libreoffice.libreoffice-writer).)*$ 
Nothing to do!

er...@thelundfamily.net

unread,
Apr 26, 2020, 5:53:20 PM4/26/20
to autokey-users
Something worth noting.  The Window Filter checks whether either the Window Class or the Window Title matches the regular expression, so, for example, if in the case below, "libreoffice.libreoffice-writer" is the Window Class, but "My Document" is the window title and "libreoffice.libreoffice-writer" is not found in the Window Title, then your window will match the filter and not be excluded.  You need to find something unique in both the Window Class and the Window Title and exclude both pieces.  I discovered this trying to set up one set of phrases to use for copy and paste using "<alt>+c" and "<alt>+v" for normal things and a different phrase to use for terminal windows.  All of my terminal window titles are "my_username@my_computer:<stuff>" and my Window Classes all contain the word "terminal" (in varying combinations of mixed case).  To avoid matching that, I wound up having to use something like:

(?i)^((?!((my_username[@]my_computer)|(terminal))).)*$

Since it took digging in the source to figure this out, I thought it might be useful to someone.

Joe

unread,
Apr 26, 2020, 7:08:36 PM4/26/20
to autoke...@googlegroups.com
Putting a logical or in the filter is an interesting idea.

Eventually, we'll get this fixed. See
https://github.com/autokey/autokey/issues/305 .

Joe
> --
> You received this message because you are subscribed to the Google
> Groups "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autokey-user...@googlegroups.com
> <mailto:autokey-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/5f092c53-64d2-433e-8204-af0c6c6fbee9%40googlegroups.com
> <https://groups.google.com/d/msgid/autokey-users/5f092c53-64d2-433e-8204-af0c6c6fbee9%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages