52 lines
1.6 KiB
Bash
52 lines
1.6 KiB
Bash
# .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
|
|
|
|
# ldd doesn't exist on OS X, but otool -L does the same thing.
|
|
alias ldd='otool -L'
|
|
|
|
SOUNDSDIR=/System/Library/Sounds
|
|
alias glass="afplay $SOUNDSDIR/Glass.aiff"
|
|
alias funk="afplay $SOUNDSDIR/Funk.aiff"
|
|
unset SOUNDSDIR
|
|
|
|
function darwin-icloud-drive-path
|
|
{
|
|
echo "$HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs"
|
|
}
|
|
|
|
function darwin-init
|
|
{
|
|
# Dim dock icons of apps that have been hidden.
|
|
print_info "Auto-hiding Dock"
|
|
defaults write com.apple.Dock showhidden -boolean yes
|
|
killall Dock
|
|
|
|
# Put screenshots in iCloud Drive, in a directory according to hostname
|
|
icloud=`darwin-icloud-drive-path`
|
|
if [[ -d "$icloud" ]]; then
|
|
local name=`hostname -s | tr A-Z a-z`
|
|
local loc="`darwin-icloud-drive-path`/Screenshots/$name"
|
|
print_info "Setting screenshot directory: $loc"
|
|
mkdir -p "$loc"
|
|
defaults write com.apple.screencapture location "$loc"
|
|
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
|
|
}
|