Do some crazy stuff with OPTIND to unbreak getopts interoperation.

This commit is contained in:
Ivan Malison 2014-08-26 12:47:43 -07:00
parent ca17d69e4a
commit d731e62b04
6 changed files with 252 additions and 250 deletions

View File

@ -119,7 +119,7 @@ function do_the_brew() {
esac esac
done done
echo "Installing the following packages:" echo "Installing the following packages:"
for package_name in "${install_items[@]}"; do echo $package_name; done; for package_name in "${install_items[@]}"; do printf '\t%s\n' $package_name; done;
brew update brew update
brew_install_items $install_items brew_install_items $install_items
brew cleanup brew cleanup

View File

@ -228,10 +228,10 @@ function ss() {
} }
function git_config_string() { function git_config_string() {
git config -f $1 --list | xargs -I kv sh -c "echo \\\"kv\\\"" | xargs | tr '\n' ' ' git config -f $1 --list | xargs -I kv printf '-c \"%s\" ' kv
} }
function brew_for_multiple_user() { function brew_for_multiple_users() {
sudo chgrp -R admin /usr/local sudo chgrp -R admin /usr/local
sudo chmod -R g+w /usr/local sudo chmod -R g+w /usr/local
sudo chgrp -R admin /Library/Caches/Homebrew sudo chgrp -R admin /Library/Caches/Homebrew

View File

@ -1,4 +1,5 @@
function install_python_packages() { function install_python_packages() {
easy_install pip
ESSENTIAL=(ipdb ipython virtualenv) ESSENTIAL=(ipdb ipython virtualenv)
FOR_EDITOR=(jedi pyflakes) FOR_EDITOR=(jedi pyflakes)
USEFUL=( USEFUL=(

View File

@ -1,5 +1,3 @@
function vimstall() { function vimstall() {
# This sucks, but BundleInstall fails otherwise.
sudo chmod -R 775 $(readlink -f ~/.vim)
vim +BundleInstall! +q +q vim +BundleInstall! +q +q
} }

View File

@ -1,327 +1,327 @@
#!/usr/bin/env bash function osx_config() {
# Ask for the administrator password upfront
sudo -v
# Ask for the administrator password upfront # Keep-alive: update existing `sudo` time stamp until `.osx` has finished
sudo -v while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished ###############################################################################
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # General UI/UX #
###############################################################################
############################################################################### # Menu bar: disable transparency
# General UI/UX # defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
###############################################################################
# Menu bar: disable transparency # Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "YES"
# Menu bar: show remaining battery time (on pre-10.8); hide percentage # Menu bar: hide the useless Time Machine and Volume icons
defaults write com.apple.menuextra.battery ShowPercent -string "YES" defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Clock.menu"
defaults write com.apple.menuextra.battery ShowTime -string "YES"
# Menu bar: hide the useless Time Machine and Volume icons # Always show scrollbars
defaults write com.apple.systemuiserver menuExtras -array "/System/Library/CoreServices/Menu Extras/Bluetooth.menu" "/System/Library/CoreServices/Menu Extras/AirPort.menu" "/System/Library/CoreServices/Menu Extras/Battery.menu" "/System/Library/CoreServices/Menu Extras/Clock.menu" defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic"
# Always show scrollbars # Disable opening and closing window animations
defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic" defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Disable opening and closing window animations # Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false defaults write NSGlobalDomain NSWindowResizeTime -float 0.08
# Increase window resize speed for Cocoa applications # Disable the “Are you sure you want to open this application?” dialog
defaults write NSGlobalDomain NSWindowResizeTime -float 0.08 defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable the “Are you sure you want to open this application?” dialog # Display ASCII control characters using caret notation in standard text views
defaults write com.apple.LaunchServices LSQuarantine -bool false # Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Display ASCII control characters using caret notation in standard text views # Disable Resume system-wide
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt` defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Disable Resume system-wide # Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable automatic termination of inactive apps # Set Help Viewer windows to non-floating mode
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true defaults write com.apple.helpviewer DevMode -bool true
# Set Help Viewer windows to non-floating mode # Reveal IP address, hostname, OS version, etc. when clicking the clock
defaults write com.apple.helpviewer DevMode -bool true # in the login window
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Reveal IP address, hostname, OS version, etc. when clicking the clock # Restart automatically if the computer freezes
# in the login window systemsetup -setrestartfreeze on
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Restart automatically if the computer freezes # Never go into computer sleep mode
systemsetup -setrestartfreeze on systemsetup -setcomputersleep Off > /dev/null
# Never go into computer sleep mode # Check for software updates daily, not just once per week
systemsetup -setcomputersleep Off > /dev/null defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Check for software updates daily, not just once per week ###############################################################################
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 # Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
############################################################################### # Trackpad: enable tap to click for this user and for the login screen
# Trackpad, mouse, keyboard, Bluetooth accessories, and input # defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
############################################################################### defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Trackpad: enable tap to click for this user and for the login screen # Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Increase sound quality for Bluetooth headphones/headsets # Enable full keyboard access for all controls
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 # (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable full keyboard access for all controls # Enable access for assistive devices
# (e.g. enable Tab in modal dialogs) echo -n 'a' | sudo tee /private/var/db/.AccessibilityAPIEnabled > /dev/null 2>&1
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 sudo chmod 444 /private/var/db/.AccessibilityAPIEnabled
# TODO: avoid GUI password prompt somehow (http://apple.stackexchange.com/q/60476/4408)
# Enable access for assistive devices # Use scroll gesture with the Ctrl (^) modifier key to zoom
echo -n 'a' | sudo tee /private/var/db/.AccessibilityAPIEnabled > /dev/null 2>&1 defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
sudo chmod 444 /private/var/db/.AccessibilityAPIEnabled defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# TODO: avoid GUI password prompt somehow (http://apple.stackexchange.com/q/60476/4408) # Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Use scroll gesture with the Ctrl (^) modifier key to zoom # Set a blazingly fast keyboard repeat rate
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true defaults write NSGlobalDomain KeyRepeat -int 1
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate # Automatically illuminate built-in MacBook keyboard in low light
defaults write NSGlobalDomain KeyRepeat -int 1 defaults write com.apple.BezelServices kDim -bool true
# Turn off keyboard illumination when computer is not used for 5 minutes
defaults write com.apple.BezelServices kDimTime -int 300
# Automatically illuminate built-in MacBook keyboard in low light # Set language and text formats
defaults write com.apple.BezelServices kDim -bool true # Note: if youre in the US, replace `EUR` with `USD`, `Centimeters` with
# Turn off keyboard illumination when computer is not used for 5 minutes # `Inches`, and `true` with `false`.
defaults write com.apple.BezelServices kDimTime -int 300 defaults write NSGlobalDomain AppleLanguages -array "en"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
defaults write NSGlobalDomain AppleMetricUnits -bool false
# Set language and text formats # Disable auto-correct
# Note: if youre in the US, replace `EUR` with `USD`, `Centimeters` with defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# `Inches`, and `true` with `false`.
defaults write NSGlobalDomain AppleLanguages -array "en"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
defaults write NSGlobalDomain AppleMetricUnits -bool false
# Disable auto-correct ###############################################################################
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false # Screen #
###############################################################################
############################################################################### # Save screenshots to the desktop
# Screen # defaults write com.apple.screencapture location -string "$HOME/Desktop"
###############################################################################
# Save screenshots to the desktop # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture location -string "$HOME/Desktop" defaults write com.apple.screencapture type -string "png"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) # Disable shadow in screenshots
defaults write com.apple.screencapture type -string "png" defaults write com.apple.screencapture disable-shadow -bool true
# Disable shadow in screenshots # Enable subpixel font rendering on non-Apple LCDs
defaults write com.apple.screencapture disable-shadow -bool true defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Enable subpixel font rendering on non-Apple LCDs # Enable HiDPI display modes (requires restart)
defaults write NSGlobalDomain AppleFontSmoothing -int 2 sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
# Enable HiDPI display modes (requires restart) ###############################################################################
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true # Finder #
###############################################################################
############################################################################### # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
# Finder # defaults write com.apple.finder QuitMenuItem -bool true
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons # Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder QuitMenuItem -bool true defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Show icons for hard drives, servers, and removable media on the desktop # Finder: show hidden files by default
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true defaults write com.apple.finder AppleShowAllFiles -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Finder: show hidden files by default # Finder: show all filename extensions
defaults write com.apple.finder AppleShowAllFiles -bool true defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show all filename extensions # Finder: show status bar
defaults write NSGlobalDomain AppleShowAllExtensions -bool true defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show status bar # Finder: allow text selection in Quick Look
defaults write com.apple.finder ShowStatusBar -bool true defaults write com.apple.finder QLEnableTextSelection -bool true
# Finder: allow text selection in Quick Look # Display full POSIX path as Finder window title
defaults write com.apple.finder QLEnableTextSelection -bool true defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Display full POSIX path as Finder window title # When performing a search, search the current folder by default
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# When performing a search, search the current folder by default # Disable the warning when changing a file extension
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Disable the warning when changing a file extension # Avoid creating .DS_Store files on network volumes
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Avoid creating .DS_Store files on network volumes # Disable disk image verification
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Disable disk image verification # Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages skip-verify -bool true defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Automatically open a new Finder window when a volume is mounted # Show item info near icons on the desktop and in other icon views
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info near icons on the desktop and in other icon views # Show item info to the right of the icons on the desktop
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info to the right of the icons on the desktop # Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views # Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# Increase grid spacing for icons on the desktop and in other icon views # Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views # Use list view in all Finder windows by default
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# Use list view in all Finder windows by default # Disable the warning before emptying the Trash
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv` defaults write com.apple.finder WarnOnEmptyTrash -bool false
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash # Don't Empty Trash securely by default
defaults write com.apple.finder WarnOnEmptyTrash -bool false defaults write com.apple.finder EmptyTrashSecurely -bool false
# Don't Empty Trash securely by default # Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.finder EmptyTrashSecurely -bool false defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Enable AirDrop over Ethernet and on unsupported Macs running Lion # Show the ~/Library folder
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true chflags nohidden ~/Library
# Show the ~/Library folder # Remove Dropboxs green checkmark icons in Finder
chflags nohidden ~/Library file=/Applications/Dropbox.app/Contents/Resources/check.icns
[ -e "$file" ] && mv -f "$file" "$file.bak"
unset file
# Remove Dropboxs green checkmark icons in Finder ###############################################################################
file=/Applications/Dropbox.app/Contents/Resources/check.icns # Dock & hot corners #
[ -e "$file" ] && mv -f "$file" "$file.bak" ###############################################################################
unset file
############################################################################### # Enable highlight hover effect for the grid view of a stack (Dock)
# Dock & hot corners # defaults write com.apple.dock mouse-over-hilite-stack -bool true
###############################################################################
# Enable highlight hover effect for the grid view of a stack (Dock) # Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock mouse-over-hilite-stack -bool true defaults write com.apple.dock tilesize -int 36
# Set the icon size of Dock items to 36 pixels # Enable spring loading for all Dock items
defaults write com.apple.dock tilesize -int 36 defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Enable spring loading for all Dock items # Show indicator lights for open applications in the Dock
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true defaults write com.apple.dock show-process-indicators -bool true
# Show indicator lights for open applications in the Dock # Dont group windows by application in Mission Control
defaults write com.apple.dock show-process-indicators -bool true # (i.e. use the old Exposé behavior instead)
defaults write com.apple.dock expose-group-by-app -bool false
# Dont group windows by application in Mission Control # Dont show Dashboard as a Space
# (i.e. use the old Exposé behavior instead) defaults write com.apple.dock dashboard-in-overlay -bool true
defaults write com.apple.dock expose-group-by-app -bool false
# Dont show Dashboard as a Space # Remove the auto-hiding Dock delay
defaults write com.apple.dock dashboard-in-overlay -bool true defaults write com.apple.Dock autohide-delay -float 0
# Remove the auto-hiding Dock delay # Enable the 2D Dock
defaults write com.apple.Dock autohide-delay -float 0 #defaults write com.apple.dock no-glass -bool true
# Enable the 2D Dock # Automatically hide and show the Dock
#defaults write com.apple.dock no-glass -bool true defaults write com.apple.dock autohide -bool true
# Automatically hide and show the Dock # Make Dock icons of hidden applications translucent
defaults write com.apple.dock autohide -bool true defaults write com.apple.dock showhidden -bool true
# Make Dock icons of hidden applications translucent # Reset Launchpad
defaults write com.apple.dock showhidden -bool true find ~/Library/Application\ Support/Dock -name "*.db" -maxdepth 1 -delete
# Reset Launchpad # Hot corners
find ~/Library/Application\ Support/Dock -name "*.db" -maxdepth 1 -delete # Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# Top right screen corner → Desktop
defaults write com.apple.dock wvous-tr-corner -int 4
defaults write com.apple.dock wvous-tr-modifier -int 0
defaults write com.apple.dock wvous-bl-corner -int 5
defaults write com.apple.dock wvous-bl-modifier -int 0
# Hot corners ###############################################################################
# Possible values: # Time Machine #
# 0: no-op ###############################################################################
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# Top right screen corner → Desktop
defaults write com.apple.dock wvous-tr-corner -int 4
defaults write com.apple.dock wvous-tr-modifier -int 0
defaults write com.apple.dock wvous-bl-corner -int 5
defaults write com.apple.dock wvous-bl-modifier -int 0
############################################################################### # Prevent Time Machine from prompting to use new hard drives as backup volume
# Time Machine # defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
###############################################################################
# Prevent Time Machine from prompting to use new hard drives as backup volume # Disable local Time Machine backups
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true hash tmutil &> /dev/null && sudo tmutil disablelocal
# Disable local Time Machine backups ###############################################################################
hash tmutil &> /dev/null && sudo tmutil disablelocal # Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
###############################################################################
############################################################################### # Enable the debug menu in Disk Utility
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility # defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
############################################################################### defaults write com.apple.DiskUtility advanced-image-options -bool true
# Enable the debug menu in Disk Utility ###############################################################################
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true # Mac App Store #
defaults write com.apple.DiskUtility advanced-image-options -bool true ###############################################################################
############################################################################### # Enable the WebKit Developer Tools in the Mac App Store
# Mac App Store # defaults write com.apple.appstore WebKitDeveloperExtras -bool true
###############################################################################
# Enable the WebKit Developer Tools in the Mac App Store # Enable Debug Menu in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true defaults write com.apple.appstore ShowDebugMenu -bool true
# Enable Debug Menu in the Mac App Store ###############################################################################
defaults write com.apple.appstore ShowDebugMenu -bool true # Google Chrome & Google Chrome Canary #
###############################################################################
############################################################################### # Allow installing user scripts via GitHub or Userscripts.org
# Google Chrome & Google Chrome Canary # defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
############################################################################### defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
# Allow installing user scripts via GitHub or Userscripts.org ###############################################################################
defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*" # Transmission.app #
defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*" ###############################################################################
############################################################################### # Use `~/Documents/Torrents` to store incomplete downloads
# Transmission.app # defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
############################################################################### defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
# Use `~/Documents/Torrents` to store incomplete downloads # Dont prompt for confirmation before downloading
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true defaults write org.m0k.transmission DownloadAsk -bool false
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
# Dont prompt for confirmation before downloading # Trash original torrent files
defaults write org.m0k.transmission DownloadAsk -bool false defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
# Trash original torrent files # Hide the donate message
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true defaults write org.m0k.transmission WarningDonate -bool false
# Hide the legal disclaimer
# Hide the donate message defaults write org.m0k.transmission WarningLegal -bool false
defaults write org.m0k.transmission WarningDonate -bool false }
# Hide the legal disclaimer
defaults write org.m0k.transmission WarningLegal -bool false

View File

@ -4,6 +4,7 @@ source dotfiles/lib/shellrc/functions.sh
source dotfiles/lib/shellrc/brew.sh source dotfiles/lib/shellrc/brew.sh
source dotfiles/lib/shellrc/python.sh source dotfiles/lib/shellrc/python.sh
source dotfiles/lib/shellrc/vim.sh source dotfiles/lib/shellrc/vim.sh
source resources/osx.sh
DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles" DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles"
@ -74,6 +75,7 @@ function setup() {
fi fi
while getopts "acosbpev" OPTCHAR; while getopts "acosbpev" OPTCHAR;
do do
local real_opt_ind=$OPTIND
case $OPTCHAR in case $OPTCHAR in
a) a)
source resources/apt-get.sh source resources/apt-get.sh
@ -90,7 +92,7 @@ function setup() {
;; ;;
o) o)
sudo -v sudo -v
source resources/osx.sh osx_config
;; ;;
s) s)
symlink_dotfiles_prompt symlink_dotfiles_prompt
@ -104,10 +106,11 @@ function setup() {
install_python_packages $REPLY install_python_packages $REPLY
;; ;;
e) e)
case uname in case $(uname) in
Darwin) Darwin)
get_command_line_tools get_command_line_tools
get_brew && do_the_brew -au get_brew && do_the_brew -au
osx_config
;; ;;
Linux) Linux)
apt-get apt-get
@ -115,7 +118,6 @@ function setup() {
esac esac
install_python_packages -a install_python_packages -a
symlink_dotfiles symlink_dotfiles
source resources/osx.sh
vimstall vimstall
;; ;;
v) v)
@ -126,6 +128,7 @@ function setup() {
return return
;; ;;
esac esac
OPTIND=$real_opt_ind
done done
} }