[zsh] Remove nested function from darwin_configure_screenshots_directory
This commit is contained in:
parent
edd0f30a85
commit
d2713240b1
1 changed files with 13 additions and 14 deletions
|
@ -3,20 +3,19 @@
|
||||||
|
|
||||||
autoload darwin_icloud_drive_path
|
autoload darwin_icloud_drive_path
|
||||||
|
|
||||||
function darwin_configure_screenshots_directory
|
icloud=`darwin_icloud_drive_path`
|
||||||
{
|
if [[ ! -d "$icloud" ]]; then
|
||||||
icloud=`darwin_icloud_drive_path`
|
|
||||||
if [[ ! -d "$icloud" ]]; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Put screenshots in iCloud Drive, in a directory according to hostname
|
# Put screenshots in iCloud Drive, in a directory according to hostname
|
||||||
local name=`hostname -s | tr A-Z a-z | tr ' ' -`
|
local name=`hostname -s | tr A-Z a-z | tr ' ' -`
|
||||||
local screenshots_dir="$icloud/Screenshots/$name"
|
local screenshots_dir="$icloud/Screenshots/$name"
|
||||||
mkdir -p "$screenshots_dir"
|
mkdir -p "$screenshots_dir"
|
||||||
defaults write com.apple.screencapture screenshots_diration "$screenshots_dir"
|
|
||||||
|
|
||||||
return 0
|
echo "$screenshots_dir"
|
||||||
}
|
defaults write com.apple.screencapture screenshots_diration "$screenshots_dir"
|
||||||
|
|
||||||
darwin_configure_screenshots_directory "$@"
|
killall Dock
|
||||||
|
|
||||||
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue