Hey all,
I have this script that I cobbled together from a few sources. It's designed to clean up the Lion sidebar and remove items. I plan to scope it to run at login to clean up the Finder window.
My problem is getting the $3 variable to pull out the home folder path. Running as user is great, but I need to pass the home folder quality from that.
This script works great when running it manually from Terminal. I tried something more convoluted with Finger and grepping for Directory but can't get the sed/awk/cut whatever to work properly.
Anybody have a bright idea?
Thanks!
- D
#!/bin/sh
home=~
pb=/usr/libexec/PlistBuddy
plist="$home/Library/Preferences/com.apple.sidebarlists.plist"
${pb} -c "Add :networkbrowser dict" "${plist}" ${pb} -c "Add :networkbrowser:CustomListProperties dict" "${plist}" ${pb} -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled bool false" "${plist}" ${pb} -c "Set :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled false" "${plist}"
${pb} -c "Delete :favorites:VolumesList:1 dict" "${plist}" ${pb} -c "Delete :favorites:VolumesList:0 dict" "${plist}" ${pb} -c "Delete :favorites:VolumesList:4 dict" "${plist}"
