Fix customize_user_settings.

This commit is contained in:
Livien Yin 2014-11-10 03:37:59 -08:00 committed by Ivan Malison
parent fbce9d7949
commit b5cae4497b
2 changed files with 15 additions and 18 deletions

View File

@ -4,26 +4,21 @@ sudo -v
# 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 &
echo "Configuring osx."
###############################################################################
# General UI/UX #
###############################################################################
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Menu bar: hide the Time Machine, Volume, User, and Bluetooth icons
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
defaults write "${domain}" dontAutoLoad -array \
"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
"/System/Library/CoreServices/Menu Extras/Volume.menu" \
"/System/Library/CoreServices/Menu Extras/User.menu"
# Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "YES"
# Menu bar: hide the useless Time Machine and Volume icons
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"
# Always show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "Automatic"
# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.08
@ -324,3 +319,4 @@ defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
defaults write org.m0k.transmission WarningDonate -bool false
# Hide the legal disclaimer
defaults write org.m0k.transmission WarningLegal -bool false
echo "Finished successfully."

View File

@ -37,11 +37,12 @@ def dotfiles(ctx, flags=''):
@ctask
def powerline(ctx):
ctx.run('pip install --user git+git://github.com/Lokaltog/powerline')
ctx.run('sudo pip install git+git://github.com/Lokaltog/powerline')
@ctask
def install_python_libraries(ctx):
ctx.run('sudo pip install setuptools --upgrade')
ctx.run('sudo pip install -r {0}'.format(
os.path.join(RESOURCES_DIRECTORY, 'requirements.txt')
))
@ -67,9 +68,9 @@ def change_shell(ctx):
@ctask
def customize_user_settings(ctx):
input_function = input if sys.version_info.major == 3 else raw_input
username = input_function("Enter the user's full name")
email = input_function("Enter the user's Email.")
with os.path.expanduser('~/.gitconfig.custom', 'w') as custom_file:
username = input_function("Enter the user's full name: ")
email = input_function("Enter the user's email address: ")
with open(os.path.expanduser('~/.gitconfig.custom'), 'w') as custom_file:
custom_file.write("""[user]
name = {0}
email = {1}""".format(username, email))