예제 #1
0
파일: main.py 프로젝트: willsim/happymac
 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()
예제 #2
0
파일: main.py 프로젝트: laffra/happymac
 def update_statusbar(self):
     icon = self.get_icon(process.get_cpu_percent())
     if self.icon is not icon:
         self.icon = icon
예제 #3
0
 def update_statusbar(self):
     self.icon = self.get_icon(process.get_cpu_percent())