I'm looking for a way to have my program started when user logins or when system boots up. The program needs to have root privilege and it needs to display some UI stuff on the top menu bar.
I have tried using launchd to start it as daemon and agents. The problem is daemons can't have UI. And agents are run as the user so it doesn't have root privilege.
I also tried having a daemon to call a script using setsid() to have my program running in a different process group but that didn't help either. It just can't show any UI stuff.
I am new to OSX and really need some help about this.