[zsh] Update init-macos

This commit is contained in:
Eryn Wells 2019-05-18 16:56:50 -07:00
parent e856c04bbf
commit f783d87bb0

View file

@ -34,8 +34,17 @@ function init-macos
killall Dock
# Put screenshots in Google Drive, in a directory according to hostname
name=`hostname -s | tr A-Z a-z`
loc="$HOME/Google Drive/Screenshots/$name"
mkdir -p "$loc"
defaults write com.apple.screencapture location "$loc"
icloud=`darwin-icloud-drive-path`
if [[ -d "$icloud" ]]; then
name=`hostname -s | tr A-Z a-z`
loc="$icloud/Screenshots/$name"
mkdir -p "$loc"
defaults write com.apple.screencapture location "$loc"
else
echo "iCloud directory doesn't exist: $icloud"
fi
echo "Disabling overly restrictive Gatekeeper"
# See https://techstuffer.com/this-app-is-damaged-error-macos-sierra/
sudo spctl --master-disable
}