2013-09-04 20:26:10 -07:00
|
|
|
# .rc.darwin
|
|
|
|
# vim: ft=zsh
|
|
|
|
# Interactive shell setup for Darwin systems
|
|
|
|
# Eryn Wells <eryn@erynwells.me>
|
|
|
|
|
|
|
|
alias acls='command ls -le'
|
|
|
|
|
|
|
|
# These things might have been installed by Homebrew, and I like the GNU versions better.
|
|
|
|
binary_exists gdircolors && alias dircolors='gdircolors'
|
|
|
|
binary_exists gfind && alias find='gfind'
|
|
|
|
binary_exists gnuindent && alias indent='gnuindent'
|
|
|
|
|
|
|
|
if binary_exists gls; then
|
|
|
|
configure_ls `which gls`
|
|
|
|
fi
|
2014-05-22 19:18:14 -07:00
|
|
|
|
|
|
|
# ldd doesn't exist on OS X, but otool -L does the same thing.
|
|
|
|
alias ldd='otool -L'
|
2016-02-22 23:12:49 -08:00
|
|
|
|
|
|
|
SOUNDSDIR=/System/Library/Sounds
|
|
|
|
alias glass="afplay $SOUNDSDIR/Glass.aiff"
|
|
|
|
alias funk="afplay $SOUNDSDIR/Funk.aiff"
|
|
|
|
unset SOUNDSDIR
|
2016-11-02 09:40:05 -07:00
|
|
|
|
2018-04-08 06:52:04 -07:00
|
|
|
function darwin-icloud-drive-path
|
|
|
|
{
|
2021-03-02 08:37:09 -08:00
|
|
|
echo "$HOME/Library/Mobile Documents/com~apple~CloudDocs"
|
2018-04-08 06:52:04 -07:00
|
|
|
}
|
|
|
|
|
2019-11-08 16:27:53 -08:00
|
|
|
function darwin-init
|
2016-11-02 09:40:05 -07:00
|
|
|
{
|
|
|
|
# Dim dock icons of apps that have been hidden.
|
2019-11-08 16:27:53 -08:00
|
|
|
print_info "Auto-hiding Dock"
|
2016-11-02 09:40:05 -07:00
|
|
|
defaults write com.apple.Dock showhidden -boolean yes
|
|
|
|
killall Dock
|
2016-11-20 09:44:38 -08:00
|
|
|
|
2019-11-08 16:27:53 -08:00
|
|
|
# Put screenshots in iCloud Drive, in a directory according to hostname
|
2019-05-18 16:56:50 -07:00
|
|
|
icloud=`darwin-icloud-drive-path`
|
|
|
|
if [[ -d "$icloud" ]]; then
|
2019-11-08 16:27:53 -08:00
|
|
|
local name=`hostname -s | tr A-Z a-z`
|
2021-03-02 08:37:09 -08:00
|
|
|
local loc="$(darwin-icloud-drive-path)/Screenshots/$name"
|
2019-11-08 16:27:53 -08:00
|
|
|
print_info "Setting screenshot directory: $loc"
|
|
|
|
mkdir -p "$loc"
|
|
|
|
defaults write com.apple.screencapture location "$loc"
|
2019-05-18 16:56:50 -07:00
|
|
|
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
|
2016-11-02 09:40:05 -07:00
|
|
|
}
|