def __init__(self): super(VagrantBar, self).__init__(name="VB", icon="assets/icon.png") self.vagrant = Vagrant() self.menu = [] self.build_menu() self.menu.add('') # Here we update the menu in the background: sched = BackgroundScheduler() def scheduled_updater(): self.update_menu() sched.add_job(scheduled_updater, 'interval', seconds=5) sched.start()