Ejemplo n.º 1
0
	def __init__(self, list_workspaces=False):
		self.list_workspaces = list_workspaces
		self.active = Active(windows=self)
		self.focus = Focus(windows=self)
		Wnck.set_client_type(Wnck.ClientType.PAGER)
		self.staging = False
		self.visible = []
		self.visible_map = {}
		self.buffers = []
		self.screen = None
		self.line = self.column = None
Ejemplo n.º 2
0
                )
                self.ind.set_icon(self.icon_pause_gpu)

            else:

                # TODO: Must test if there *IS* a GPU (CcState.have_gpu())
                # Set UI for 'gpu active'
                self.check_set_active("suspend_resume_gpu", False)
                self.menu["status_gpu"].set_label(_("GPU computing is enabled"))
                self.ind.set_icon(self.icon_normal)

            # (re-)show menus for 'cpu active'
            self.menu["status_gpu"].show()

        # (re-)show menus for 'connected' as last action,
        # to avoid any visual glitches
        self.menu["status_net"].show()
        self.menu["status_cpu"].show()

        return True  # returning False would deactivate update timer


if __name__ == "__main__":
    GLib.set_application_name(__appname__)
    GLib.set_prgname(__apptag__)
    Wnck.set_client_type(Wnck.ClientType.PAGER)
    # TODO: add command-line arguments (via argparse), specially --refresh
    # Which could move from __init__() to main()
    ind = BoincIndicator()
    sys.exit(ind.main())
Ejemplo n.º 3
0
    }
}  # type: Dict[str, CfgDict]

#: Used for resolving certain keysyms
#:
#: .. todo:: Figure out how to replace :data:`KEYLOOKUP` with a fallback that
#:      uses something in `Gtk <http://lazka.github.io/pgi-docs/Gtk-3.0/>`_ or
#:      ``python-xlib`` to look up the keysym from the character it types.
KEYLOOKUP = {
    ',': 'comma',
    '.': 'period',
    '+': 'plus',
    '-': 'minus',
}

Wnck.set_client_type(Wnck.ClientType.PAGER)


class QuickTileApp(object):
    """The basic Glib application itself.

    :param commands: The command registry to use to resolve command names.
    :param keys: A dict mapping :func:`Gtk.accelerator_parse` strings to
        command names.
    :param modmask: A modifier mask to prepend to all ``keys``.
    :param winman: The window manager to invoke commands with so they can act.
    """
    def __init__(
        self,
        winman: WindowManager,
        commands: commands.CommandRegistry,
Ejemplo n.º 4
0
def _configure_process():
    Wnck.set_client_type(Wnck.ClientType.PAGER)
    setproctitle.setproctitle("pocoy")
    unix_signal_add = _signal_function()
    for sig in (SIGINT, SIGTERM, SIGHUP):
        unix_signal_add(GLib.PRIORITY_HIGH, sig, _unix_signal_handler, sig)