2

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?

4

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.

  • 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
  • This worked for me, but I noticed that after running the offending app, it would initially appear under "login items" until I restarted my machine. – Stan James Dec 12 '15 at 19:00
  • My Mac doesn't have a ~/Library/Preferences/com.apple.loginitems.plist item. Granted this answer is six years old. There is a ~/Library/Preferences/com.apple.loginwindow.plist item? – jtheletter Mar 23 at 0:45
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .