diff --git a/rc.darwin b/rc.darwin index cc45db7..62bd94f 100644 --- a/rc.darwin +++ b/rc.darwin @@ -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 }