jaredks / rumps

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

Custom handler for KeyboardInterrupt #205

Open jabbson opened 11 months ago

jabbson commented 11 months ago

I am looking for a way to handle KeyboardInterrupt to gracefully shutdown the app and preserve data/progress. For example the app keeps track of events and I would like to pickle them before shutting down if the app was stopped by Ctrl-c. Is there a way to do that?

porovaara commented 3 months ago

would second this, but ".quit_application()" doesn't seem to work for me at all. however letting the app populate with the default quit button and choosing that works every time, but unfortunately i have a function that is needed as part of the quit process.

rumps also seems to over ride my own signal handler.

porovaara commented 3 months ago

Can't edit my above comment. rumps seems to conflict with NSWorkspace functionality from Appkit as well.