Esempio n. 1
0
    def __wm_init__(self):
        try:
            self.mw_biff_mailpath = os.environ['MAIL']
        except KeyError:
            sys.stderr.write('%s: $MAIL not set, mw_biff disabled\n' % sys.argv[0])
            return

        self.mw_biff_mailp = 0

        self.mw_biff_mailmsg = self.rdb_get('.modewindow.mail.text',
                                    '.ModeWindow.Mail.Text',
                                    self.mw_biff_mail_message)

        self.mw_biff_newmsg = self.rdb_get('.modewindow.newMail.text',
                                           '.ModeWindow.NewMail.Text',
                                           self.mw_biff_new_mail_message)

        self.mw_biff_message = modewindow.Message(self.mw_biff_position,
                                                  self.mw_biff_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_biff_message)

        self.dispatch.add_handler(BiffEventType, self.mw_biff_tick)

        self.mw_biff_update()
Esempio n. 2
0
    def __wm_init__(self):
        # Figure out which ACPI interface to use
        for ai in acpi_interfaces:
            if ai.probe():
                self.mw_acpi_interface = ai
                break
        else:
            # No matching ACPI interface, skip rest of our installation
            sys.stderr.write(
                '%s: failed to find a parsable ACPI interface, disabling mw_acpi'
                % sys.argv[0])
            return

        self.mw_acpi_message = modewindow.Message(self.mw_acpi_position,
                                                  self.mw_acpi_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_acpi_message)

        self.dispatch.add_handler(TimerEventType, self.mw_acpi_tick)

        self.mw_acpi_socket = ai.get_event_socket()
        if self.mw_acpi_socket:
            self.dispatch.add_handler(ACPIEventType,
                                      self.mw_acpi_handle_socket_event)
            self.mw_acpi_socket_event = event.FileEvent(
                ACPIEventType, self.mw_acpi_socket, event.FileEvent.READ)
            self.events.add_file(self.mw_acpi_socket_event)

        self.mw_acpi_poll(1)
Esempio n. 3
0
 def __init__(self, keyhandler):
     keys.KeyHandler.__init__(self, keyhandler.wm)
     self._keyhandler = keyhandler
     self._message = modewindow.Message(.1, modewindow.LEFT, 0,
                                        '[Bypassing]')
     self._screen = keyhandler.wm.current_screen
     self._screen.modewindow_add_message(self._message)
Esempio n. 4
0
        def __wm_init__(self):

            self.wm_xmms_message = modewindow.Message(self.mw_xmms_position,
                                                      self.mw_xmms_justification)

            for s in self.screens:
                s.modewindow_add_message(self.wm_xmms_message)

                self.dispatch.add_handler(XMMSTimerEvent,self.mw_xmms_tick)
                self.mw_xmms_update()
Esempio n. 5
0
    def __wm_init__(self):
        self.mw_clock_format = self.rdb_get('.modewindow.clock.format',
                                            '.ModeWindow.Clock.Format',
                                            '%H:%M')

        self.mw_clock_message = modewindow.Message(self.mw_clock_position,
                                                   self.mw_clock_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_clock_message)

        self.dispatch.add_handler(ClockEventType, self.mw_clock_tick)

        self.mw_clock_update()
Esempio n. 6
0
        def __wm_init__(self):
            """Create a mode window message and connect to the XMMS2 server."""
            self.wm_xmms2_message = modewindow.Message(self.mw_xmms2_position,
                self.mw_xmms2_justification)

            self.mw_xmms2_connection = xmmsclient.XMMS("mw_xmms2")
            self.mw_xmms2_connect ()

            for s in self.screens:
                s.modewindow_add_message(self.wm_xmms2_message)

            self.dispatch.add_handler(XMMS2TimerEvent, self.mw_xmms2_tick)
            self.dispatch.add_handler(XMMS2ReconnectEvent, self.mw_xmms2_reconnect)
            self.mw_xmms2_update()
Esempio n. 7
0
    def __wm_init__(self):
        if not self.mw_watchfiles:
            sys.stderr.write('mw_watchfiles: no files to watch, disabling myself')
            return

        self.mw_watchfiles_last_msg = None

        self.mw_watchfiles_message = modewindow.Message(self.mw_watchfiles_position,
                                                        self.mw_watchfiles_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_watchfiles_message)

        self.dispatch.add_handler(TimerEventType, self.mw_watchfiles_tick)

        self.mw_watchfiles_tick(None)
Esempio n. 8
0
    def __wm_init__(self):
        for i in load_interfaces:
            if i.probe():
                self.mw_load_interface = i
                break
        else:
            sys.stderr.write('%s: failed to find a load interface, disabling mw_load\n' % sys.argv[0])
            return

        self.mw_load_message = modewindow.Message(self.mw_load_position,
                                                   self.mw_load_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_load_message)

        self.dispatch.add_handler(LoadTimerEvent, self.mw_load_tick)
        self.mw_load_update()
Esempio n. 9
0
    def __wm_init__(self):
        # Figure out which APM interface to use
        for ai in apm_interfaces:
            if ai.probe():
                self.mw_apm_interface = ai
                break
        else:
            # No matching APM interface, skip rest of our installation
            sys.stderr.write(
                '%s: failed to find a parsable APM interface, disabling mw_apm'
                % sys.argv[0])
            return

        self.mw_apm_message = modewindow.Message(self.mw_apm_position,
                                                 self.mw_apm_justification)
        for s in self.screens:
            s.modewindow_add_message(self.mw_apm_message)

        self.dispatch.add_handler(TimerEventType, self.mw_apm_tick)

        self.mw_apm_update()
Esempio n. 10
0
        def __wm_init__(self):

            self.wm_gmail_message = modewindow.Message(
                self.mw_gmail_position, self.mw_gmail_justification)
            try:
                conf = file('%s/.mw_gmailrc' % os.environ['HOME'], 'r')
                lines = conf.readlines()
                conf.close()

                self.account = lines[0].strip()
                self.password = lines[1].strip()

                for s in self.screens:
                    s.modewindow_add_message(self.wm_gmail_message)

                    self.dispatch.add_handler(GMAILTimerEvent,
                                              self.mw_gmail_tick)
                    self.mw_gmail_update()
            except:
                sys.stderr.write('mw_gmail: no %s/.mw_gmailrc file found\n' %
                                 os.environ['HOME'])
                import traceback
                traceback.print_exc()
Esempio n. 11
0
 def __wm_screen_init__(self):
     self.mw_traceim_unseen_clients = {}
     self.mw_traceim_message = modewindow.Message(
         self.mw_traceim_position, self.mw_traceim_justification)