Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
window filter exclusion does not work
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  18 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joon  
View profile  
 More options Jan 17, 3:24 pm
From: Joon <joonp...@gmail.com>
Date: Tue, 17 Jan 2012 12:24:41 -0800 (PST)
Local: Tues, Jan 17 2012 3:24 pm
Subject: window filter exclusion does not work
Hi,

One of the discussions Chris said:

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.

I tried this but it is not working for me. (I'm using autokey 0.81.4)

First of all, in normal python console,

>>> re.search('^((?!.*VirtualBox OSE).)*$', 'asrtas VirtualBox OSE trsietnsri')

Does not give me any match. So it seems the regex is not matching the
string even though it does not end with VirtualBox OSE.

Anyway, at least it is excluding any string with VirtualBox OSE, so I
tried to set it in my window filter, but whatever window name I try it
did not work.

Could you please give me some help on this?

Best,
Joon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 18, 10:02 am
From: Al <itscoolrea...@gmail.com>
Date: Wed, 18 Jan 2012 07:02:50 -0800 (PST)
Local: Wed, Jan 18 2012 10:02 am
Subject: Re: window filter exclusion does not work
Joon,

Try taking all the regex stuff out and using simple wildcards, which
work for me. Try *VirtualBox*.

- Al

On Jan 17, 2:24 pm, Joon <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 18, 11:32 am
From: "Joon Ro" <joonp...@gmail.com>
Date: Wed, 18 Jan 2012 10:32:24 -0600
Local: Wed, Jan 18 2012 11:32 am
Subject: Re: window filter exclusion does not work
Hi Al,

Thanks for the reply. The thing is I am trying to exclude some windows,  
not include.

-Joon

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 18, 9:24 pm
From: Al <itscoolrea...@gmail.com>
Date: Wed, 18 Jan 2012 18:24:46 -0800 (PST)
Local: Wed, Jan 18 2012 9:24 pm
Subject: Re: window filter exclusion does not work
Joon,

Oh, sorry about that. Can you give us a list of window titles that are
open at the time when you are expecting this filter work correctly?
Give us both a list of window titles that match and do not match
according to what you think is supposed to happening based on that
pattern. Maybe we can help you further with that kind of data.

Thanks,

Al

On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 18, 9:38 pm
From: Al <itscoolrea...@gmail.com>
Date: Wed, 18 Jan 2012 18:38:24 -0800 (PST)
Local: Wed, Jan 18 2012 9:38 pm
Subject: Re: window filter exclusion does not work
Joon,

Ok, so I looked at the re.search information at python to understand
that filter better, then I made one of my own but for gedit windows.
And it worked great, I could successfully cause my macro to not run in
windows matching that portion of the title but run in others. So what
version of Ubuntu, python and autokey are you running?

-Al

On Jan 18, 10:32 am, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 18, 10:58 pm
From: "Joon Ro" <joonp...@gmail.com>
Date: Wed, 18 Jan 2012 21:58:56 -0600
Local: Wed, Jan 18 2012 10:58 pm
Subject: Re: window filter exclusion does not work
Hi Al,

Thanks. Actually I'm using autokey 0.81.4 with openSUSE 12.1. The system  
python version is 2.7.2.
Can you please show me what did you use to exclude gedit? Maybe I can try  
your regex.

-Joon

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 19, 10:54 am
From: Al <itscoolrea...@gmail.com>
Date: Thu, 19 Jan 2012 07:54:24 -0800 (PST)
Local: Thurs, Jan 19 2012 10:54 am
Subject: Re: window filter exclusion does not work
Hi Joon,

Ironically, I replaced all of your text for "Virtualbox OSE" with
"gedit". I then made sure I have several apps open that would respond
to my macro including a gedit window. It was the gedit window that
didn't react to the macro, not until i changed the regex enough to
make it the match mechanism not recognize the gedit window. So, I
performed no real magic here. However, I can think of one thing, if
your window title text is not matching entirely, ie, does it end in
OSE or is it ending in OSE and a letter? I ask because the last '.'
means match one character. I want you try leaving off that last '.'
and seeing what happens. In the meantime i'm installing virtualbox-ose
to see if i duplicate your problem.

- al

On Jan 18, 9:58 pm, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 19, 10:11 pm
From: "Joon Ro" <joonp...@gmail.com>
Date: Thu, 19 Jan 2012 21:11:35 -0600
Local: Thurs, Jan 19 2012 10:11 pm
Subject: Re: window filter exclusion does not work
Hi Al,

Thank you very much for your help.
I just tried gedit as well and gedit case it seems to be working for me as  
well.
And please don't install Virtualbox OSE because that was the example chris  
was using,
and I'm not having trouble with that.

Let me give you one of my example. I want to exclude the LyX window.
My LyX window's title is

LyX: ~/workspace/newfile1.lyx

And whatever I try, I cannot make autokey to exclude this.
For example,

^((?!LyX.*).)*$

does not work.

-Joon

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 20, 1:48 pm
From: Al <itscoolrea...@gmail.com>
Date: Fri, 20 Jan 2012 10:48:42 -0800 (PST)
Local: Fri, Jan 20 2012 1:48 pm
Subject: Re: window filter exclusion does not work
Joon,

ok, try this ^?!Lyx*$

- Al

On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 20, 2:36 pm
From: Al <itscoolrea...@gmail.com>
Date: Fri, 20 Jan 2012 11:36:06 -0800 (PST)
Local: Fri, Jan 20 2012 2:36 pm
Subject: Re: window filter exclusion does not work
Joon,

Sorry for the repeated postings. So it looks like you are doing this
from a terminal. So I opened my terminal and starting fiddling and lo
and behold, I couldn't get my terminal window to except either with
the filtering thing. But I did notice some interesting functions in
autokey like get_window_title() so I decided to use that plus some of
the more simpler re.search() capabilities of python. If you put the
following at the top of your script, I believe you will have no
problem excluding your LyX windows.

import re
t = window.get_active_title()
m = re.search("LyX", t)
if m==None:
      # code to execute if 'LyX' is not in the title
      # ...
      # more code
      # ...
      # etc ...
else:
      # code to execute if 'Lyx' IS IN the title
      # ...
      # more code
      # ...
      # etc ...

I know that is bit contrived up there, I did it just in case someone
doesn't entirely understand python and wanted to do the same thing.
Hopefully it'll help them. But using that code structure I was able to
exclude my terminal window which started as "alan@homefront" and
instead of 'LyX' and I had used 'alan' in line 3.

Enjoy,

Al

On Jan 19, 9:11 pm, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 22, 2:01 am
From: "Joon Ro" <joonp...@gmail.com>
Date: Sun, 22 Jan 2012 01:01:03 -0600
Local: Sun, Jan 22 2012 2:01 am
Subject: Re: window filter exclusion does not work
Hi Al,

Thanks again for your reply. I tried the following:

title = window.get_active_title()
if title.find('LyX:') == -1:
     keyboard.send_keys('test string')

with some abbreviation. I just used str.find() instead of importing re  
module.
It seems to be working, but strangely within 2 or 3 tries, autokey freezes.
I don't know what is going on, but when I run autokey from the terminal to  
see any messages,
when autokey freezes, autokey types the 'test string' in the TERMINAL  
window instead of
whatever window I had evoked the script.

Are you having any autokey freezing problem with the script?

-Joon

--
Using Opera's revolutionary email client: http://www.opera.com/mail/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 22, 9:32 am
From: Al <itscoolrea...@gmail.com>
Date: Sun, 22 Jan 2012 06:32:41 -0800 (PST)
Local: Sun, Jan 22 2012 9:32 am
Subject: Re: window filter exclusion does not work
Hi Joon,

I had the behavioral problem back in the 0.7x version. But when I
upgraded it went away. The only prime difference between us now is the
distribution type. Let us see if we can evoke even more error messages
from autokey, make sure it is not running and from terminal do:
"autokey-gtk -l", this way a ton of verbose message will write to
console. Then open your "LyX" thing or TERMINAL that you were testing
in and see what you get. Hopefully you'll get an error traceback that
Chris can use to debug the system or that one of us can use to figure
out the exact nature of the problem you are having now.

Btw, I like how you reduced what I did there.

- Al

On Jan 22, 1:01 am, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 22, 9:35 am
From: Al <itscoolrea...@gmail.com>
Date: Sun, 22 Jan 2012 06:35:28 -0800 (PST)
Local: Sun, Jan 22 2012 9:35 am
Subject: Re: window filter exclusion does not work
Joon,

Another idea. Can you make a live screen cast and upload it to youtube
and send that link here so we can see exactly what is going on
according to the way you described it. Or give us painful step by step
instruction as to how to achieve what you are experiencing now
according to how you just described it.

Thanks,

- Al

On Jan 22, 1:01 am, "Joon Ro" <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 22, 3:55 pm
From: "Joon Ro" <joonp...@gmail.com>
Date: Sun, 22 Jan 2012 14:55:03 -0600
Local: Sun, Jan 22 2012 3:55 pm
Subject: Re: window filter exclusion does not work
Hi Al,

So this is the log. I grabbed only part where it happens. I tried this  
with 'opera.OperaNext' window. I have a script with

Abbreviations: \a
"Omit trigger character" is the only thing checked

and the script content is:

title = window.get_active_title()
if title.find('LyX:') == -1:
     keyboard.send_keys('lpha')

I tried several times, and it worked, until suddenly autokey automatically  
changes the window to 'terminator.Terminator' and then just hangs.
So whatever I do, after the last two lines of the log, nothing happens. No  
error message, anything.
I haven't done the livescreen thing yet but I will try to do that when I  
have time. Thanks a lot for your help!

-Joon

2012-01-22 14:48:31,554 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:31,557 DEBUG - service - Input stack at end of  
handle_keypress: [' ', ' ', '\n', '\n']
2012-01-22 14:48:31,887 DEBUG - service - Raw key: u'\\', modifiers: [],  
Key: \
2012-01-22 14:48:31,887 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:31,887 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:31,889 DEBUG - service - Input stack at end of  
handle_keypress: [' ', ' ', '\n', '\n', u'\\']
2012-01-22 14:48:32,007 DEBUG - service - Raw key: u'a', modifiers: [],  
Key: a
2012-01-22 14:48:32,007 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:32,007 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,009 DEBUG - service - Input stack at end of  
handle_keypress: [' ', ' ', '\n', '\n', u'\\', u'a']
2012-01-22 14:48:32,159 DEBUG - service - Raw key: u' ', modifiers: [],  
Key:
2012-01-22 14:48:32,160 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:32,160 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,161 DEBUG - service - Script runner executing:  
Script('alpha')
2012-01-22 14:48:32,161 DEBUG - service - Input stack at end of  
handle_keypress: []
2012-01-22 14:48:32,161 DEBUG - interface - Send special key:  
['<backspace>']
2012-01-22 14:48:32,170 DEBUG - service - Ignored locking error in  
handle_keypress
2012-01-22 14:48:32,171 DEBUG - iomediator - Send via event interface
2012-01-22 14:48:32,178 DEBUG - interface - Sending string: u'lpha'
2012-01-22 14:48:32,671 DEBUG - service - Raw key: u' ', modifiers: [],  
Key:
2012-01-22 14:48:32,671 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:32,673 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:32,675 DEBUG - service - Input stack at end of  
handle_keypress: [' ']
2012-01-22 14:48:33,000 DEBUG - service - Raw key: u'\\', modifiers: [],  
Key: \
2012-01-22 14:48:33,001 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:33,001 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,003 DEBUG - service - Input stack at end of  
handle_keypress: [' ', u'\\']
2012-01-22 14:48:33,071 DEBUG - service - Raw key: u'a', modifiers: [],  
Key: a
2012-01-22 14:48:33,071 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:33,071 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,073 DEBUG - service - Input stack at end of  
handle_keypress: [' ', u'\\', u'a']
2012-01-22 14:48:33,167 DEBUG - service - Raw key: u' ', modifiers: [],  
Key:
2012-01-22 14:48:33,167 DEBUG - service - Window visible title: u'Re:  
window filter exclusion does not work - Opera Next', Window class:  
'opera.OperaNext'
2012-01-22 14:48:33,167 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:33,168 DEBUG - service - Input stack at end of  
handle_keypress: []
2012-01-22 14:48:33,168 DEBUG - service - Ignored locking error in  
handle_keypress
2012-01-22 14:48:33,168 DEBUG - service - Script runner executing:  
Script('alpha')
2012-01-22 14:48:33,169 DEBUG - interface - Send special key:  
['<backspace>']
2012-01-22 14:48:33,178 DEBUG - iomediator - Send via event interface
2012-01-22 14:48:37,022 DEBUG - interface - Sending string: u'lpha'
2012-01-22 14:48:37,025 DEBUG - service - Raw key: u'\\', modifiers: [],  
Key: \
2012-01-22 14:48:37,026 DEBUG - service - Window visible title:  
u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator'
2012-01-22 14:48:37,026 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,028 DEBUG - service - Input stack at end of  
handle_keypress: [u'\\']
2012-01-22 14:48:37,030 DEBUG - service - Raw key: u'a', modifiers: [],  
Key: a
2012-01-22 14:48:37,030 DEBUG - service - Window visible title:  
u'autokey-gtk -l > autokeyerror.log', Window class: 'terminator.Terminator'
2012-01-22 14:48:37,030 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,032 DEBUG - service - Input stack at end of  
handle_keypress: [u'\\', u'a']
2012-01-22 14:48:37,135 DEBUG - service - Raw key: u' ', modifiers: [],  
Key:
2012-01-22 14:48:37,136 DEBUG - service - Window visible title:  
u'joon@linux-0sd0: ~/sources/Gnome-Pie', Window class:  
'terminator.Terminator'
2012-01-22 14:48:37,136 DEBUG - service - No phrase/script matched hotkey
2012-01-22 14:48:37,138 DEBUG - service - Input stack at end of  
handle_keypress: []
2012-01-22 14:48:37,138 DEBUG - service - Ignored locking error in  
handle_keypress
2012-01-22 14:48:37,138 DEBUG - service - Script runner executing:  
Script('alpha')
2012-01-22 14:48:37,160 DEBUG - iomediator - Send via event interface

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
uj  
View profile  
 More options Jan 22, 5:02 pm
From: uj <ujih...@gmail.com>
Date: Sun, 22 Jan 2012 14:02:29 -0800 (PST)
Local: Sun, Jan 22 2012 5:02 pm
Subject: Re: window filter exclusion does not work
I found that it's because the filter means (1) it matches to the
Window title or (2) it matches to the Window class.

src/lib/model.py
268     def _should_trigger_window_title(self, windowInfo):
269         r = self.get_applicable_regex()
270         if r is not None:
271             return r.match(windowInfo[0]) or
r.match(windowInfo[1])
272         else:
273             return True

line 271 is the key.

So if you want to exclude a Window, you always have to specify a
keyword that doesn't match neither its title nor class. I think
"VirtualBox OSE" is a good keyword for the title but I don't think it
unmatches to the class.

This issue is basically caused by the asymmetricity of matching/
unmatching. I propose that autokey provides negate option in the
Window filtering.

On Jan 17, 12:24 pm, Joon <joonp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
uj  
View profile  
 More options Jan 22, 5:09 pm
From: uj <ujih...@gmail.com>
Date: Sun, 22 Jan 2012 14:09:28 -0800 (PST)
Local: Sun, Jan 22 2012 5:09 pm
Subject: Re: window filter exclusion does not work
I personally changed the line 271 to

    return r.match(windowInfo[1])

to only check the window class, and I specified keywords only about
window class. It worked for me.

On Jan 22, 2:02 pm, uj <ujih...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al  
View profile  
 More options Jan 22, 7:14 pm
From: Al <itscoolrea...@gmail.com>
Date: Sun, 22 Jan 2012 16:14:08 -0800 (PST)
Local: Sun, Jan 22 2012 7:14 pm
Subject: Re: window filter exclusion does not work
Uj,

Do you think this will solve his latest problem or all of it?

- Al

On Jan 22, 4:09 pm, uj <ujih...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joon Ro  
View profile  
 More options Jan 22, 7:35 pm
From: "Joon Ro" <joonp...@gmail.com>
Date: Sun, 22 Jan 2012 18:35:40 -0600
Local: Sun, Jan 22 2012 7:35 pm
Subject: Re: window filter exclusion does not work

On Sun, 22 Jan 2012 18:14:08 -0600, Al <itscoolrea...@gmail.com> wrote:

> On Jan 22, 4:09 pm, uj <ujih...@gmail.com> wrote:
>> I personally changed the line 271 to

>>     return r.match(windowInfo[1])

>> to only check the window class, and I specified keywords only about
>> window class. It worked for me.

It worked like a charm. Thanks!

>> > This issue is basically caused by the asymmetricity of matching/
>> > unmatching. I propose that autokey provides negate option in the
>> > Window filtering.

+1

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »