jaredks / rumps

Ridiculously Uncomplicated macOS Python Statusbar apps
BSD 3-Clause "New" or "Revised" License
3.06k stars 177 forks source link

[help] How can I update string shows up on the to bar every minute #190

Closed avatar-lavventura closed 1 year ago

avatar-lavventura commented 1 year ago

I want to update Awesome App string that shows up on the top bar every 20 seconds.

Is it possible to update the string that shows up on the top bar? If yes, could you direct me with a simple example.

jaredks commented 1 year ago

Let me know if this is what you were looking for.

import rumps

class App(rumps.App):
    @rumps.timer(2)
    def change_title(self, sender):
        if self.title == self.name:
            self.title = "Fantastic App"
        else:
            self.title = self.name

if __name__ == "__main__":
    App("Awesome App").run()
avatar-lavventura commented 1 year ago

@jaredks Thanks.