Skip to content

Instantly share code, notes, and snippets.

@vitorgalvao
Last active June 6, 2024 08:47
Show Gist options
  • Save vitorgalvao/f0bac70751004e0d3d1ef6b88b51f6e9 to your computer and use it in GitHub Desktop.
Save vitorgalvao/f0bac70751004e0d3d1ef6b88b51f6e9 to your computer and use it in GitHub Desktop.
Prevent Dropbox password dialog
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.vitorgalvao.launchd.preventdropboxdialog</string>
<key>ProgramArguments</key>
<array>
<string>/bin/chmod</string>
<string>0000</string>
<string>/Applications/Dropbox.app/Contents/Resources/DropboxHelperInstaller.tgz</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Applications/Dropbox.app/Contents/Resources/DropboxHelperInstaller.tgz</string>
</array>
</dict>
</plist>

If you don’t give Dropbox your password, it pesters you on startup. You can avoid that by setting 0000 permissions on the Dropbox.app/Contents/Resources/DropboxHelperInstaller.tgz file, but that only lasts until the next Dropbox update. To make it permanent, we install a launchd job which will watch that file for changes and reset the permissions as we want them.

If you have Dropbox installed somewhere other than /Applications/Dropbox.app, edit the plist accordingly.

Install

mkdir -p "${HOME}/Library/LaunchAgents"
curl 'https://gist.githubusercontent.com/vitorgalvao/f0bac70751004e0d3d1ef6b88b51f6e9/raw/5c9bb853d85f9da99d7e4b89e18e0f6d8a5321c4/com.vitorgalvao.launchd.preventdropboxdialog.plist' --output "${HOME}/Library/LaunchAgents/com.vitorgalvao.launchd.preventdropboxdialog.plist"
launchctl bootstrap "gui/$(id -u "${USER}")" "${HOME}/Library/LaunchAgents/com.vitorgalvao.launchd.preventdropboxdialog.plist"

Uninstall

launchctl bootout "gui/$(id -u "${USER}")" "${HOME}/Library/LaunchAgents/com.vitorgalvao.launchd.preventdropboxdialog.plist"
rm "${HOME}/Library/LaunchAgents/com.vitorgalvao.launchd.preventdropboxdialog.plist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment