From f783d87bb0fc3853cb6d0ad576fa6621df6186c6 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 18 May 2019 16:56:50 -0700 Subject: [PATCH] [zsh] Update init-macos --- rc.darwin | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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 }