23 lines
576 B
Text
23 lines
576 B
Text
|
#!/usr/bin/env zsh
|
||
|
# Eryn Wells <eryn@erynwells.me>
|
||
|
|
||
|
autoload darwin_icloud_drive_path
|
||
|
|
||
|
function darwin_configure_screenshots_directory
|
||
|
{
|
||
|
icloud=`darwin_icloud_drive_path`
|
||
|
if [[ ! -d "$icloud" ]]; then
|
||
|
return 1
|
||
|
fi
|
||
|
|
||
|
# Put screenshots in iCloud Drive, in a directory according to hostname
|
||
|
local name=`hostname -s | tr A-Z a-z`
|
||
|
local screenshots_dir="$icloud/Screenshots/$name"
|
||
|
mkdir -p "$screenshots_dir"
|
||
|
defaults write com.apple.screencapture screenshots_diration "$screenshots_dir"
|
||
|
|
||
|
return 0
|
||
|
}
|
||
|
|
||
|
darwin_configure_screenshots_directory "$@"
|