Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a program start up automatically in OSX?

I have a little program that I want to make open automatically when my mac is started up.

Because this program accepts command line arguments, its not as simple as just going to System Prefs/Accounts/Login items and adding it there...

From google, I read that I can create a .profile file in my user's home folder, and that will execute whatever I put in it... So I have a .profile page in ~ like this:

-rw-r--r--@ 1 matt staff 27 27 Sep 13:36 .profile

That contains this...

/Applications/mousefix 3.5

But it doesn't execute on startup! If I enter "/Applications/mousefix 3.5" manually into the terminal, it does work.

Any ideas?

like image 577
Matt Roberts Avatar asked Oct 01 '08 16:10

Matt Roberts


People also ask

Why do some programs open automatically on my Mac?

The app might have installed its own startup software. Often this is controlled by a setting within the app. Check the app's preferences or documentation, or contact the app's developer.

How do you stop programs from starting on startup?

Go to Task Manager by clicking the Windows icon, select the settings icon (gear symbol), then type Task Manager in the search box. 2. Select the Startup tab. Highlight any progam you don't want to start automatically, then click Disable.

Does Mac Have a Startup folder?

Actually, there are two Library folders which could hold Startup Items. Open Finder on your Mac. From the menu bar, select Go > Go to Folder… Find the LaunchAgents and LaunchDaemons folders containing your Startup Items.


2 Answers

From here and into the future, look into launchd for what you want to do. All other methods have been deprecated or are now unsupported. This is probably a bit more heavy-weight than what you want, though.

It could also be a problem with your version of the bash shell not correctly executing your .profile. Try putting the command into .bashrc in your home directory, and see if that helps.

like image 144
rpj Avatar answered Sep 25 '22 17:09

rpj


You can use Lingon to help construct a plist file for launchd.

like image 25
DGentry Avatar answered Sep 24 '22 17:09

DGentry