macospaintalways-on-top

How do I paint an always-on-top green circle on my macOS display?


How do I create a program that paints an always-on-top small green circle on my screen?

Is it possible in AppleScript, Python or Java? Is Swift or Objective-C needed? Solutions in all programming languages are most welcome!


Solution

  • It was simple to create a macOS menu bar app using Python, Rumps, and py2app.

    This guide explains the basics, which is basically:

    import rumps
    
    class GreenCircleApp(object):
        def __init__(self):
            self.app = rumps.App("GreenCircle", "🟢")
    
        def run(self):
            self.app.run()
    
    if __name__ == '__main__':
        app = GreenCircleApp()
        app.run()
    

    The circle can easily be changed using e.g. self.app.title = "🔴"