Help with menubar app

Search did not return any results so here is my issue.

I'm trying to create a small Alfred inspired menubar app which will have following features:

  • start on system start
  • activate popover on keyboard shortcut
  • on enter run selected app by executing command in terminal (or if there is another way please advise)

I've managed to create the app and move it from dock to menubar. When I click on the menubar icon it opens popover and I can type in it.

I'm sure I can get the value of typed string but that is where everything falls apart.

I can not get it to:

  • start on login
  • activate popover on global keyboard shortcut
  • and run selected app

Can anyone point me in the right direction, to some tutorials or anything that will help me solve this.

Thanks in advance.

You are asking about building an Apple application. Probably off-topic for these forums since it's not about Swift (you could write the entire application in Objective-C, for example). You might try StackOverflow or the Apple Developer forums, for assistance.

Start on login: You want to help the user add your app to login/startup items How to remove startup items on your Mac | Macworld

activate. on global: I am not sure about the exact mechanism. I tried looking in Karabiner-elements but didn't know what I was looking for. Similar to the startup items, it has something to do with accessibility and control of the computer. (It's the reason that Alfred is in the Accessibility section on security)

Amongst other things

Daemons and Services Programming Guide outline how to work with background process and scheduled jobs, including login items.

start on login

Check out my LaunchAtLogin package which makes this easy.

Since my app is already "an agent" in order to just show up in menubar, from your suggestions it should just be added to "Login items" and it will work? Great if that is all it takes, but how to do that through an option within the app?

@sindresorhus I'm not sure how to use your package and if everything works when the app is an agent then there is no need for it, right?

Any suggestions about the rest? Thanks everyone.

This is very Mac specific stuff, and so I’m reluctant to chime in here on Swift Forums. If you want to start a thread over on DevForums, and specifically in the Core OS > Processes topic area, I’d be happy to help out there.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple