DEV Community

Cover image for MacOS Python Statusbar apps
VORG
VORG

Posted on • Edited on

MacOS Python Statusbar apps

rumps

Star 2.6k Watch 46 Fork 167

Ridiculously Uncomplicated macOS Python Statusbar apps.

Image description

import rumps

class AwesomeStatusBarApp(rumps.App):
    @rumps.clicked("Preferences")
    def prefs(self, _):
        rumps.alert("jk! no preferences available!")

    @rumps.clicked("Silly button")
    def onoff(self, sender):
        sender.state = not sender.state

    @rumps.clicked("Say hi")
    def sayhi(self, _):
        rumps.notification("Awesome title", "amazing subtitle", "hi!!1")

if __name__ == "__main__":
    AwesomeStatusBarApp("Awesome App").run()
Enter fullscreen mode Exit fullscreen mode

How fun!?

rumps can greatly shorten the code required to generate a working app. No PyObjC underscore syntax required!

Use case

rumps is for any console-based program that would benefit from a simple configuration toolbar or launch menu.

Good for:

  • Notification-center-based app

  • Controlling daemons / launching separate programs

  • Updating simple info from web APIs on a timer

Not good for:

  • Any app that is first and foremost a GUI application

License

Modified BSD License.

Top comments (0)