Sometimes the best way to learn something is by example. Form your own application based on some of these samples.

Simple subclass structure

Just a straightforward application,

import rumps

class AwesomeStatusBarApp(rumps.App):
    def __init__(self):
        super(AwesomeStatusBarApp, self).__init__("Awesome App")
        self.menu = ["Preferences", "Silly button", "Say hi"]

    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__":

Decorating any functions

The following code demonstrates how you can decorate functions with rumps.clicked() whether or not they are inside a subclass of rumps.App. The parameter sender, the rumps.MenuItem object, is correctly passed to both functions even though button needs an instance of SomeApp as its self parameter.

Usually functions registered as callbacks should accept one and only one argument but an App subclass is viewed as a special case as its use can provide a simple and pythonic way to implement the logic behind an application.

from rumps import *

def tester(sender):
    sender.state = not sender.state

class SomeApp(rumps.App):
    def __init__(self):
        super(SomeApp, self).__init__(type(self).__name__, menu=['On', 'Testing'])

    def button(self, sender):
        sender.title = 'Off' if sender.title == 'On' else 'On'
        Window("I can't think of a good example app...").run()

if __name__ == "__main__":

New features in 0.2.0

Menu items can be disabled (greyed out) by passing None to rumps.MenuItem.set_callback(). rumps.alert() no longer requires title (will use a default localized string) and allows for custom cancel button text. The new parameter quit_button for rumps.App allows for custom quit button text or removal of the quit button entirely by passing None.


By setting rumps.App.quit_button to None you must include another way to quit the application by somehow calling rumps.quit_application() otherwise you will have to force quit.

import rumps


@rumps.clicked('Print Something')
def print_something(_):
    rumps.alert(message='something', ok='YES!', cancel='NO!')

@rumps.clicked('On/Off Test')
def on_off_test(_):
    print_button = app.menu['Print Something']
    if print_button.callback is None:

@rumps.clicked('Clean Quit')
def clean_up_before_quit(_):
    print 'execute clean up code'

app = rumps.App('Hallo Thar', menu=['Print Something', 'On/Off Test', 'Clean Quit'], quit_button=None)