Bamf.Matcher

g Bamf.Matcher Bamf.Matcher GObject.Object GObject.Object GObject.Object->Bamf.Matcher

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get_default ()

application_is_running (desktop_file)

get_active_application ()

get_active_window ()

get_application_for_desktop_file (desktop_file_path, create_if_not_found)

get_application_for_window (window)

get_application_for_xid (xid)

get_applications ()

get_running_applications ()

get_tabs ()

get_window_for_xid (xid)

get_window_stack_for_monitor (monitor)

get_windows ()

get_xids_for_application (desktop_file)

register_favorites (favorites)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

active-application-changed

active-window-changed

stacking-order-changed

view-closed

view-opened

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Bamf.Matcher(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Bamf.MatcherClass

classmethod get_default()
Returns:

A new Bamf.Matcher

Return type:

Bamf.Matcher

Returns the default matcher. This matcher is owned by bamf and shared between other callers.

application_is_running(desktop_file)
Parameters:

desktop_file (str) –

Return type:

bool

get_active_application()
Returns:

The active Bamf.Application.

Return type:

Bamf.Application

Used to fetch the active Bamf.Application.

get_active_window()
Returns:

The active Bamf.Window.

Return type:

Bamf.Window

Used to fetch the active Bamf.Window.

get_application_for_desktop_file(desktop_file_path, create_if_not_found)
Parameters:
  • desktop_file_path (str) – Path to the desktop file

  • create_if_not_found (bool) – Create a Bamf.Application if one isn’t found

Returns:

A Bamf.Application for given desktop file.

Return type:

Bamf.Application

get_application_for_window(window)
Parameters:

window (Bamf.Window) – The window to look for

Returns:

The Bamf.Application representing the xid passed, or None if none exists.

Return type:

Bamf.Application

Used to fetch the Bamf.Application containing the passed window.

get_application_for_xid(xid)
Parameters:

xid (int) – The XID to search for

Returns:

The Bamf.Application representing the xid passed, or None if none exists.

Return type:

Bamf.Application

Used to fetch the Bamf.Application containing the passed xid.

get_applications()
Returns:

A list of Bamf.Application's.

Return type:

[Bamf.Application]

Used to fetch all Bamf.Application's running or not. Application authors who wish to only see running applications should use Bamf.Matcher.get_running_applications instead. The reason this method is needed is bamf will occasionally track applications which are not currently running for nefarious purposes.

get_running_applications()
Returns:

A list of Bamf.Application's.

Return type:

[Bamf.Application]

Used to fetch all Bamf.Application's which are running.

get_tabs()
Returns:

A list of Bamf.Tab's.

Return type:

[Bamf.Tab]

Used to fetch all Bamf.View's representing tabs. Currently unused.

get_window_for_xid(xid)
Parameters:

xid (int) – The X11 Window ID to search for

Returns:

The Bamf.Window representing the xid passed, or None if none exists.

Return type:

Bamf.Window

Used to fetch the Bamf.Window that wraps the given window.

get_window_stack_for_monitor(monitor)
Parameters:

monitor (int) – the monitor you want the stack from, negative value to get all

Returns:

A list of Bamf.Window's.

Return type:

[Bamf.Window]

Used to fetch all windows that BAMF knows about in the requested screen, in stacking bottom-to-top order. If the monitor is set to a negative value, then it fetches all the available windows in all monitors.

get_windows()
Returns:

A list of Bamf.Window's.

Return type:

[Bamf.Window]

Used to fetch all windows that BAMF knows about.

get_xids_for_application(desktop_file)
Parameters:

desktop_file (str) –

Returns:

A list of xids.

Return type:

[int]

Used to fetch all xid’s associated with an application. Useful for performing window

register_favorites(favorites)
Parameters:

favorites ([str]) – an array of strings, each containing an absolute path to a .desktop file

Used to effect how bamf performs matching. Desktop files passed to this method will be prefered by bamf to system desktop files.

Signal Details

Bamf.Matcher.signals.active_application_changed(matcher, object, p0)
Signal Name:

active-application-changed

Flags:

Parameters:
Bamf.Matcher.signals.active_window_changed(matcher, object, p0)
Signal Name:

active-window-changed

Flags:

Parameters:
Bamf.Matcher.signals.stacking_order_changed(matcher)
Signal Name:

stacking-order-changed

Flags:

Parameters:

matcher (Bamf.Matcher) – The object which received the signal

Bamf.Matcher.signals.view_closed(matcher, object)
Signal Name:

view-closed

Flags:

Parameters:
Bamf.Matcher.signals.view_opened(matcher, object)
Signal Name:

view-opened

Flags:

Parameters: