lbry-sdk/lbrynet/lbrynet_daemon/LBRYOSXStatusBar.py

25 lines
683 B
Python
Raw Normal View History

2016-02-19 06:07:19 +01:00
import rumps
import xmlrpclib
import os
2016-02-25 23:17:07 +01:00
import webbrowser
2016-02-19 06:07:19 +01:00
class DaemonStatusBarApp(rumps.App):
def __init__(self):
super(DaemonStatusBarApp, self).__init__("LBRYnet", icon=os.path.join(os.path.expanduser("~"), "Downloads/lbryio//web/img/fav/apple-touch-icon.png"), quit_button=None)
2016-02-25 23:17:07 +01:00
self.menu = ["Open UI", "Quit"]
@rumps.clicked('Open UI')
def get_ui(self):
webbrowser.open("lbry://lbry")
2016-02-19 06:07:19 +01:00
@rumps.clicked('Quit')
def clean_quit(self):
2016-02-25 23:17:07 +01:00
daemon = xmlrpclib.ServerProxy('http://localhost:7080')
daemon.stop()
2016-02-19 06:07:19 +01:00
rumps.quit_application()
2016-02-25 23:17:07 +01:00
def main():
DaemonStatusBarApp().run()
if __name__ == '__main__':
main()