osx updates, brew.sh updates.

This commit is contained in:
Ivan Malison 2014-08-25 17:06:42 -07:00
parent aa5812c336
commit 202b217520
5 changed files with 68 additions and 81 deletions

View File

@ -1,10 +1,11 @@
function brew_install_items() { function brew_install_items() {
echo $@
for package_install_string in $@; for package_install_string in $@;
do do
# Horrible hack to induce word splitting. # Horrible hack to induce word splitting.
eval "package_args=($package_install_string)" eval "package_args=($package_install_string)"
brew install $package_args; brew install $package_args;
brew link $package_args[0]; brew link $package_args[1];
done done
} }
@ -25,6 +26,7 @@ function do_the_brew() {
"greadlink" "greadlink"
"vim --override-system-vi" "vim --override-system-vi"
"zsh" "zsh"
"make"
) )
# `find`, `locate`, `updatedb`, and `xargs`, g-prefixed # `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
# core utilities (those that come with OS X are outdated) # core utilities (those that come with OS X are outdated)
@ -47,7 +49,6 @@ function do_the_brew() {
"wget --enable-iri" "wget --enable-iri"
) )
SHOULD_INSTALL=( SHOULD_INSTALL=(
"watch"
"nmap" "nmap"
"readline" "readline"
"netcat" "netcat"
@ -61,7 +62,10 @@ function do_the_brew() {
"hub" "hub"
"tig" "tig"
"heroku" "heroku"
"make" "scala"
"sbt"
"node"
"npm"
) )
MISC=( MISC=(
"file-formula" "file-formula"
@ -69,48 +73,51 @@ function do_the_brew() {
"less" "less"
"openssh --with-brewed-openssl" "openssh --with-brewed-openssl"
"perl518" "perl518"
"python --with-brewed-openssl"
"rsync" "rsync"
"svn" "svn"
"unzip" "unzip"
"macvim --override-system-vim --custom-system-icons" "macvim --override-system-vim --custom-system-icons"
) )
SCALA=(scala sbt)
JAVASCRIPT=(node npm)
brew update install_items=()
brew tap homebrew/dupes while getopts "uebsmah" OPTCHAR;
brew install homebrew/dupes/grep
while getopts "uebsma" OPTCHAR;
do do
case $OPTCHAR in case $OPTCHAR in
u) u)
brew upgrade brew upgrade
;; ;;
e) e)
brew_install_items $ESSENTIAL install_items=("${install_items[@]}" "${ESSENTIAL[@]}")
fix_brew_htop fix_brew_htop
;; ;;
b) b)
brew_install_items $BASICS install_items=("${install_items[@]}" "${BASICS[@]}")
;; ;;
s) s)
brew_install_items $SHOULD_INSTALL install_items=("${install_items[@]}" "${SHOULD_INSTALL[@]}")
;; ;;
m) m)
brew_install_items $MISC install_items=("${install_items[@]}" "${MISC[@]}")
brew_install_items $SCALA
brew_install_items $JAVASCRIPT
;; ;;
a) a)
brew_install_items $ESSENTIAL install_items=("${install_items[@]}" "${ESSENTIAL[@]}" "${BASICS[@]}" "${SHOULD_INSTALL[@]}" "${MISC[@]}")
brew_install_items $BASICS
brew_install_items $SHOULD_INSTALL
brew_install_items $MISC
brew_install_items $SCALA
brew_install_items $JAVASCRIPT
;; ;;
h)
echo "Usage:
-a install all packages.
-u upgrade brew packages.
-e install essential packages
-b install GNU basics including replacements for non GNU versions included in OSX.
-s install a wider range of packages.
-m install very non-essential packages.
-h display this help message.
"
return
esac esac
done done
echo "Installing:"
for package_name in $install_items; do echo $package_name; done;
brew update
brew_install_items $install_items
brew cleanup brew cleanup
} }

View File

@ -226,12 +226,6 @@ function get_keyboard_vendor_id_product_id_pairs() {
ioreg -n IOHIDKeyboard -r | grep -e 'class IOHIDKeyboard' -e VendorID\" -e Product | gawk 'BEGIN { RS = "class IOHIDKeyboard" } match($0, /VendorID. = ([0-9]*)/, arr) { printf arr[1]} match($0, /ProductID. = ([0-9]*)/, arr) { printf " %s\n", arr[1]} ' ioreg -n IOHIDKeyboard -r | grep -e 'class IOHIDKeyboard' -e VendorID\" -e Product | gawk 'BEGIN { RS = "class IOHIDKeyboard" } match($0, /VendorID. = ([0-9]*)/, arr) { printf arr[1]} match($0, /ProductID. = ([0-9]*)/, arr) { printf " %s\n", arr[1]} '
} }
function startss() { function ss() {
#reattach-to-user-namespace "/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine" &
#reattach-to-user-namespace "zsh" -c "source ~/.zshrc && ssosa"
reattach-to-user-namespace "open" "/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app"
}
function ssosa() {
osascript -e "tell application \"/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app\" to activate" osascript -e "tell application \"/System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app\" to activate"
} }

View File

@ -33,3 +33,11 @@ function install_pygame() {
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
/usr/local/share/python/pip install hg+http://bitbucket.org/pygame/pygame /usr/local/share/python/pip install hg+http://bitbucket.org/pygame/pygame
} }
function install_powerline() {
hash pip 2>/dev/null || sudo easy_install pip
if test -z $(pip show Powerline | grep Location | awk '{print $2}');
then
sudo pip install --user git+git://github.com/Lokaltog/powerline
fi
}

View File

@ -10,9 +10,6 @@ while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# General UI/UX # # General UI/UX #
############################################################################### ###############################################################################
# Set computer name (as done via System Preferences → Sharing)
set_osx_hostname
# Menu bar: disable transparency # Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
@ -87,7 +84,6 @@ defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144 defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in # Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat # Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
@ -206,8 +202,8 @@ defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash # Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default # Don't Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true defaults write com.apple.finder EmptyTrashSecurely -bool false
# Enable AirDrop over Ethernet and on unsupported Macs running Lion # Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
@ -289,21 +285,6 @@ hash tmutil &> /dev/null && sudo tmutil disablelocal
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility # # Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
############################################################################### ###############################################################################
# Enable the debug menu in Address Book
defaults write com.apple.addressbook ABShowDebugMenu -bool true
# Enable Dashboard dev mode (allows keeping widgets on the desktop)
defaults write com.apple.dashboard devmode -bool true
# Enable the debug menu in iCal (pre-10.8)
defaults write com.apple.iCal IncludeDebugMenu -bool true
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
# Enable the debug menu in Disk Utility # Enable the debug menu in Disk Utility
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true defaults write com.apple.DiskUtility advanced-image-options -bool true
@ -326,16 +307,6 @@ defaults write com.apple.appstore ShowDebugMenu -bool true
defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*" 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/*" defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
###############################################################################
# SizeUp.app #
###############################################################################
# Start SizeUp at login
defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true
# Dont show the preferences window on next start
defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false
############################################################################### ###############################################################################
# Transmission.app # # Transmission.app #
############################################################################### ###############################################################################

View File

@ -1,26 +1,33 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function setup() {
cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh
source dotfiles/lib/shellrc/functions.sh source dotfiles/lib/shellrc/functions.sh
source dotfiles/lib/shellrc/brew.sh
source dotfiles/lib/shellrc/python.sh
case `uname` in case `uname` in
'Darwin') 'Darwin')
source resources/osx.sh osx_setup
source resources/brew.sh
;; ;;
'Linux') 'Linux')
source resources/apt-get.sh source resources/apt-get.sh
;; ;;
esac esac
function install_powerline() {
hash pip 2>/dev/null || sudo easy_install pip
if test -z $(pip show Powerline | grep Location | awk '{print $2}');
then
sudo pip install --user git+git://github.com/Lokaltog/powerline
fi
}
install_powerline install_powerline
source bootstrap.sh source bootstrap.sh
}
function osx_setup() {
while getopts "uebsmaho" OPTCHAR;
do
case $OPTCHAR in
h)
echo "brew options:"
do_the_brew -h
exit
;;
source resources/osx.sh
do_the_brew $@
}