caldurza / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

Option to pass WM_CLASS name to Window Class #112

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please provide any additional information below.

It is hard to identify nautilus window and Banshee window with only window 
names, so now I'm using 

system.exec_command('wmctrl -x -a Banshee.banshee')

So it would be great if autokey is able to pass WM_CLASS name to Window Class.
For example,

window.activate('Banshee.banshee', ifWM_CLASS=True)

Thank you,
Joon

Original issue reported on code.google.com by joonp...@gmail.com on 5 Apr 2011 at 12:22

GoogleCodeExporter commented 8 years ago

Original comment by cdekter on 11 Sep 2011 at 7:16

GoogleCodeExporter commented 8 years ago
I just modified the code so Window.activate accepts WM_CLASS argument:

    def activate(self, title, switchDesktop=False, WM_CLASS=False):
        """
        Activate the specified window, giving it input focus

        Usage: C{window.activate(title, switchDesktop=False)}

        If switchDesktop is False (default), the window will be moved to the current desktop
        and activated. Otherwise, switch to the window's current desktop and activate it there.

        @param title: window title to match against (as case-insensitive substring match)
        @param switchDesktop: whether or not to switch to the window's current desktop
        """
        if WM_CLASS:
            args=["-x"]
        else:
            args=[]

        if switchDesktop:
            args.append("-a")
        else:
            args.append("-R")

        args.append(title)
        self.__runWmctrl(args)

Original comment by joonp...@gmail.com on 19 Oct 2011 at 6:04

GoogleCodeExporter commented 8 years ago
Hope the above modification is accepted in the source code! :)

Original comment by joonp...@gmail.com on 19 Oct 2011 at 6:04

GoogleCodeExporter commented 8 years ago
Will be in next release

Original comment by cdekter on 19 Nov 2011 at 7:57