def update(self, force_update=False): if not force_update and self.update_skip_counter > 0: self.update_skip_counter -= 1 return self.update_skip_counter = 8 process.clear_process_cache() utils.clear_windows_cache() self.update_statusbar() percent = process.get_cpu_percent() if force_update or percent > 25 or self.menu_is_open: foreground_tasks = process.family(utils.get_current_app_pid()) background_tasks = process.top(exclude=foreground_tasks) suspender.manage(foreground_tasks, background_tasks) suspended_tasks = suspender.get_suspended_tasks() if force_update or not self.menu_is_highlighted(): self.update_menu(foreground_tasks, background_tasks, suspended_tasks, force_update) suspender.activate_current_app()
def update_statusbar(self): icon = self.get_icon(process.get_cpu_percent()) if self.icon is not icon: self.icon = icon
def update_statusbar(self): self.icon = self.get_icon(process.get_cpu_percent())