dotfiles/zsh/func/darwin_configure_screenshots_directory

22 lines
496 B
Text
Raw Normal View History

2021-12-31 11:54:55 -08:00
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
autoload darwin_icloud_drive_path
icloud=`darwin_icloud_drive_path`
if [[ ! -d "$icloud" ]]; then
return 1
fi
2021-12-31 11:54:55 -08:00
# Put screenshots in iCloud Drive, in a directory according to hostname
local name=`hostname -s | tr A-Z a-z | tr ' ' -`
local screenshots_dir="$icloud/Screenshots/$name"
mkdir -p "$screenshots_dir"
2021-12-31 11:54:55 -08:00
echo "$screenshots_dir"
defaults write com.apple.screencapture screenshots_diration "$screenshots_dir"
2021-12-31 11:54:55 -08:00
killall Dock
return 0