Esempio n. 1
0
    def __init__(self, name='memory', colors=None, interval=6.0):
        monitor.defmonitor(self._monitor_action,
                           name=name,
                           colors=colors,
                           interval=interval)

        def click_event(button):
            real_name = monitor.monitors[name].button.real_name
            return Match('RightBarClick', button, real_name)

        events.bind({click_event(_): lambda *a: self._toggle_dialog(name)})
    def __init__(self,
                 input_path=None,
                 name='temperature',
                 colors=None,
                 interval=6.0):
        self.input_path = self._find_temp_input(input_path)
        self.gpu = self._get_gpu()
        monitor.defmonitor(self._monitor_action,
                           name=name,
                           colors=colors,
                           interval=interval)

        def click_event(button):
            real_name = monitor.monitors[name].button.real_name
            return Match('RightBarClick', button, real_name)

        events.bind({click_event(_): lambda *a: self._toggle_dialog(name)})
Esempio n. 3
0
    def __init__(self, name='clock', colors=None,
            interval=2.0, format='%Y-%m-%d w%V %H:%M'):
        self.format = format
        self.calendar_process = None
        monitor.defmonitor(self._monitor_action,
                name = name,
                colors = colors,
                interval = interval)

        def click_event(button):
            real_name = monitor.monitors[name].button.real_name
            return Match('RightBarClick', button, real_name)

        events.bind({
            click_event('1'): lambda *a: self.toggle_calendar(),
            click_event('3'): lambda *a: self.toggle_tz_time_dialog(name)
        })
Esempio n. 4
0
    def __init__(self, bat_path=None, ac_path=None,
            name='battery', colors=None, interval=4.0):
        self.bat_capacity_path = _find_path(bat_path, _BAT_CAPACITY)
        self.bat_current_now_path = _find_path(bat_path, _BAT_CURRENT_NOW)
        self.bat_charge_now_path = _find_path(bat_path, _BAT_CHARGE_NOW)
        self.bat_charge_full_path = _find_path(bat_path, _BAT_CHARGE_FULL)
        self.bat_status_path = _find_path(bat_path, _BAT_STATUS)
        self.ac_online_path = _find_path(ac_path, _AC_ONLINE)
        self.current_avg = deque(maxlen=_CURRENT_AVG_SAMPLES)
        self.warned = False
        monitor.defmonitor(self._monitor_action,
                name = name,
                colors = colors,
                interval = interval)
        if not colors: colors = wmii.cache['normcolors']
        self.colors = self.normcolors = colors

        def click_event(button):
            real_name = monitor.monitors[name].button.real_name
            return Match('RightBarClick', button, real_name)

        events.bind({
            click_event(_): lambda *a: self._toggle_dialog(name)
        })