Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm new to this so forgive me for asking such a simple question.

I'm trying to run something from the command line everytime I start (or log in to) Snow Leopard. I'm actually trying to imitate this Synergy+ startup script for Leopard. Problem is the code on that page for Leopard didn't work for me under Snow Leopard. I can get it to work by opening terminal and typing:

synergys

That starts Synergy+ as a server. So it's as simple as that. Now how do I run this command every time I start my computer?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Apple menu->System Preferences...->Accounts->Your Account->Login Items

Click '+' icon at the bottom to add "synergys".

OR

Use terminal and edit or create the /etc/rc file (which is what the GUI based instructions above do.)

You should be able to just place the path to synergys and it, save, and should execute on next startup.

UPDATE

based on comment

defaults write com.apple.finder AppleShowAllFiles TRUE/FALSE

killall Finder (restarts finder after previous command is executed)

share|improve this answer
    
synergys is located in /usr/bin so I can't navigate to it from the finder. –  Andrew Nov 8 '09 at 4:49
    
Command Shift G is much easier to navigate to /usr/bin/ –  ridogi Jan 22 '10 at 17:42
add comment

From Synergy Documentation: Autostart

Mac OS X

[By Tor Slettnes]

There are three different ways to automatically start Synergy (client or server) on Mac OS X:

The first method involves creating a StartupItem at the system level, which is executed when the machine starts up or shuts down. This script will run in the background, and relaunch synergy as needed.
Pros:
Synergy is persistent, so this allows for a multi-user setup and interactive logins.
Cons:
The synergy process does not have access to the clipboard of the logged-in user.

The second method will launch Synergy from the LoginWindow application, once a particular user has logged in.
Pros:
The synergy process inherits the $SECURITYSESSIONID environment variable, and therefore copy/paste works.
Cons:
Once the user logs out, synergy dies, and no remote control is possible.

The third method is to launch a startup script from the "Startup Items" tab under System Preferences -> Accounts.
Pros:
Does not require root (Administrator) access
Cons:
Once the user logs out, synergy dies, and no remote control is possible.

share|improve this answer
add comment

Use the Login Hook :

Use the first method of the Apple Support Page.

sudo defaults write com.apple.loginwindow LoginHook /path/to/script

Do not forget the sudo otherwise it won't work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.