Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Today, I noticed that there were several "login items" that I'm 99.99999% certain I did not add. I figure those items added themselves when I installed them (they were probably installations that required authentication).

Of course, I can always check "login items" every time that I install an app (if the installer asked for authentication), but I'd prefer to lock "login items" altogether. Is that possible?

share|improve this question

2 Answers 2

Update*

if you do a get info on the ~/Library/Preferences/com.apple.loginitems.plist file and tick the lock checkbox.

enter image description here

No changes will be written to the file. Therefor on next login there will be no additions.

I just tested this and it worked. But cannot guarantee that this may or may not be a good thing to do. I my self will use my Answer below.


You can set a launchAgent to watch for changes on the ~/Library/Preferences/com.apple.loginitems.plist file

In my example here I use a launchAgent to watch for the change and then run a command to notify me. In this case I use the command tool growlnotify

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>loginItems</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/growlnotify</string>
        <string>-n</string>
        <string>login items change</string>
        <string>-m</string>
        <string>login items change</string>
        <string>-s</string>
    </array>
    <key>WatchPaths</key>
    <array>
        <string>/Users/USERNAME/Library/Preferences/com.apple.loginitems.plist</string>
    </array>
</dict>
</plist>

I actually made this using lingon which take some of the pain out of making launchAgent.

The command I run is :/usr/local/bin/growlnotify -n "login items change" -m "login items have been changed" -s

Note this is a simple example. And you should remember that any changes may take a short while to be written to the plist. But my tests have shown it to work.

share|improve this answer
    
Updated my answer –  markhunte Mar 10 '13 at 18:56
    
did you mean "launchAgent", not "lunchAgent"? –  kjo Mar 11 '13 at 17:13
    
lol. Clearly I was thinking of food at the time.. –  markhunte Mar 11 '13 at 17:33

A simple solution:

Add that application to your dock. Right click on the dock icon -> options -> uncheck "open at Login".

If you don't want the application on your dock afterward, just drag it off.

share|improve this answer

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.