Core Application Code (__main__.py)

Entry point, configuration parser, and main loop

KEYLOOKUP = {'+': 'plus', ',': 'comma', '-': 'minus', '.': 'period'}

Used for resolving certain keysyms

class QuickTileApp(winman, commands, keys, modmask='')[source]

The basic Glib application itself.

Parameters
  • commands (CommandRegistry) – The command registry to use to resolve command names.

  • keys (Dict[str, str]) – A dict mapping Gtk.accelerator_parse() strings to command names.

  • modmask (str) – A modifier mask to prepend to all keys.

  • winman (WindowManager) – The window manager to invoke commands with so they can act.

run()[source]

Initialize keybinding and D-Bus if available, then call Gtk.main().

Return type

bool

Returns

False if none of the supported backends were available.

show_binds()[source]

Print a formatted readout of defined keybindings and the modifier mask to stdout.

Return type

None

argparser()[source]

argparse.ArgumentParser definition that is compatible with sphinxcontrib.autoprogram

Return type

ArgumentParser

load_config(path)[source]

Load the config file from the given path, applying fixes as needed. If it does not exist, create it from the configuration defaults.

Parameters

path – The path to load or initialize.

Raises

TypeError – Raised if the keys or values in the [keys] section of the configuration file or what they resolve to via KEYLOOKUP are not str instances.

Return type

ConfigParser

main()[source]

setuptools-compatible entry point

Raises

XInitError – Failed to connect to the X server.

Return type

None

wnck_log_filter(domain, level, message, userdata=None)[source]

A custom function for GLib.log_set_handler() which filters out the spurious error about _OB_WM_ACTION_UNDECORATE being un-handled.

Parameters

DEFAULTS
{ 'general': { 'ColumnCount': 3,
               'ModMask': '<Ctrl><Alt>',
               'MovementsWrap': True},
  'keys': { '<Shift>KP_1': 'move-to-bottom-left',
            '<Shift>KP_2': 'move-to-bottom',
            '<Shift>KP_3': 'move-to-bottom-right',
            '<Shift>KP_4': 'move-to-left',
            '<Shift>KP_5': 'move-to-center',
            '<Shift>KP_6': 'move-to-right',
            '<Shift>KP_7': 'move-to-top-left',
            '<Shift>KP_8': 'move-to-top',
            '<Shift>KP_9': 'move-to-top-right',
            'C': 'move-to-center',
            'H': 'horizontal-maximize',
            'KP_0': 'maximize',
            'KP_1': 'bottom-left',
            'KP_2': 'bottom',
            'KP_3': 'bottom-right',
            'KP_4': 'left',
            'KP_5': 'center',
            'KP_6': 'right',
            'KP_7': 'top-left',
            'KP_8': 'top',
            'KP_9': 'top-right',
            'KP_Enter': 'monitor-switch',
            'V': 'vertical-maximize'}}

Thanks to Thomas Vander Stichele for some of the documentation cleanups during the GTK+ 2.x era.