[zsh] Update shell init: rc
This commit is contained in:
parent
b09d523218
commit
c30b46a88b
26 changed files with 479 additions and 462 deletions
24
zsh/func/darwin_configure_screenshots_directory
Normal file
24
zsh/func/darwin_configure_screenshots_directory
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/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
|
||||
shell-log -l error "iCloud directory doesn't exist: $icloud"
|
||||
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"
|
||||
shell-log "Setting screenshot directory: $screenshots_dir"
|
||||
mkdir -p "$screenshots_dir"
|
||||
defaults write com.apple.screencapture screenshots_diration "$screenshots_dir"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
darwin_configure_screenshots_directory "$@"
|
Loading…
Add table
Add a link
Reference in a new issue