Tweak osx.py. bump .emacs.d

This commit is contained in:
Ivan Malison 2014-11-11 15:52:25 -08:00
parent 6a6b0083c4
commit 4ce2cb6136
5 changed files with 39 additions and 73 deletions

View File

@ -9,11 +9,13 @@
"flash", "flash",
"flux", "flux",
"google-chrome", "google-chrome",
"google-hangouts",
"heroku-toolbelt", "heroku-toolbelt",
"iterm2", "iterm2",
"java", "java",
"karabiner", "karabiner",
"macpass", "macpass",
"osxfuse",
"seil", "seil",
"slate", "slate",
"spotify", "spotify",
@ -22,8 +24,7 @@
"transmission", "transmission",
"virtualbox", "virtualbox",
"vlc", "vlc",
"xquartz", "xquartz"
"google-hangouts"
], ],
"formulas": [ "formulas": [
"ack", "ack",

View File

@ -1,5 +1,5 @@
alias tmux="tmux -2" alias tmux="tmux -2"
alias reload_tmux_conf="tmux source-file .tmux.conf" alias reload_tmux_conf="tmux source-file ~/.tmux.conf"
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard' alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
alias timestamp='date +%s' alias timestamp='date +%s'
alias fn='find . -name ' alias fn='find . -name '

View File

@ -44,7 +44,7 @@ symbols=no
# --enable=similarities". If you want to run only the classes checker, but have # --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes # no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W" # --disable=W"
disable=C0111,C0103,R0903 disable=C0111,C0103,R0903,R0904
[REPORTS] [REPORTS]

View File

@ -11,6 +11,7 @@ vcrpy
dotfiles dotfiles
numpy numpy
readline readline
ropemacs
Flask Flask
flake8 flake8
pylint pylint

View File

@ -6,51 +6,19 @@ from . import util
@ctask(default=True) @ctask(default=True)
def all(ctx): def setup(ctx):
get_command_line_tools(ctx) cl_tools(ctx)
get_brew(ctx) brew(ctx)
cider_install(ctx) cider(ctx)
enable_access_for_assistive_devices(ctx) access_for_assistive_devices(ctx)
enable_hyper(ctx) hyper(ctx)
enable_locate(ctx) locate(ctx)
set_path_for_launchd(ctx)
install_rvm(ctx) install_rvm(ctx)
install_powerline_monaco(ctx) install_powerline_monaco(ctx)
osx_config(ctx) osx_config(ctx)
ESSENTIAL = (
"emacs --cocoa --srgb --with-x", "tmux", "python --with-brewed-openssl",
"htop", "zsh", "make", "scala", "sbt", "node", "npm", "daemonize",
"readline", "netcat", "reattach-to-user-namespace", "watch"
)
BASICS = (
"findutils", "coreutils", "binutils", "diffutils", "ed --default-names",
"gawk", "gnu-indent --default-names", "gnu-sed --default-names",
"gnu-tar --default-names", "gnu-which --default-names",
"gnutls --default-names", "grep --default-names", "gzip",
"wdiff --with-gettext", "wget --enable-iri"
)
SHOULD_INSTALL = (
"nmap", "ngrep", "gist", "gawk", "pstree", "ack", "hub", "tig", "heroku",
)
macvim_install = ("macvim --override-system-vim --custom-system-icons "
"--with-features=huge --enable-rubyinterp "
"--enable-pythoninterp --enable-perlinterp --enable-cscope")
MISC = ("file-formula", "less", "openssh --with-brewed-openssl",
"perl518", "rsync", "svn", "unzip", "docker", "boot2docker", "pandoc",
"mercurial", "ctags-exuberant", macvim_install)
CASKS = (
'caffeine', 'flux', 'google-chrome', 'iterm2', 'spotify', 'synergy',
'virtualbox', 'xquartz', 'slate', 'java', 'vlc', 'seil', 'karabiner',
'mactex'
)
@ctask @ctask
def osx_config(ctx): def osx_config(ctx):
ctx.run('sudo {0}'.format( ctx.run('sudo {0}'.format(
@ -59,7 +27,7 @@ def osx_config(ctx):
@ctask @ctask
def cider_install(ctx): def cider(ctx):
ctx.run('brew install caskroom/cask/brew-cask') ctx.run('brew install caskroom/cask/brew-cask')
if not util.command_exists('cider'): if not util.command_exists('cider'):
ctx.run('sudo pip install cider') ctx.run('sudo pip install cider')
@ -67,31 +35,21 @@ def cider_install(ctx):
@ctask @ctask
def brew_cask(ctx): def brew(ctx):
ctx.run('brew update') path = 'https://raw.githubusercontent.com/Homebrew/install/master/install)'
ctx.run('brew install caskroom/cask/brew-cask')
for cask in CASKS:
ctx.run('brew cask install {0}'.format(cask))
@ctask
def get_brew(ctx):
if not util.command_exists('brew'): if not util.command_exists('brew'):
ctx.run('ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"') ctx.run('ruby -e "$(curl -fsSL {0}'.format(path))
@ctask @ctask
def brew_install(ctx): def packages(ctx):
ctx.run('brew update') ctx.run('brew update')
for package_name in ESSENTIAL + BASICS + SHOULD_INSTALL + MISC: for package_name in ESSENTIAL + BASICS + SHOULD_INSTALL + MISC:
ctx.run('brew install {0}'.format(package_name)) ctx.run('brew install {0}'.format(package_name))
@ctask @ctask
def setup_cocoa_emacs(ctx): def set_path_for_launchd(ctx):
if not os.path.exists('/Applications/Emacs.app'):
ctx.run('ln -s $(brew --prefix emacs)/Emacs.app /Applications/Emacs.app', hide=True)
launch_agent_dir = os.path.expanduser('~/Library/LaunchAgents/') launch_agent_dir = os.path.expanduser('~/Library/LaunchAgents/')
filename = 'set-path.plist' filename = 'set-path.plist'
@ -105,19 +63,20 @@ def setup_cocoa_emacs(ctx):
APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS = ('Slate', 'Synergy', 'iTerm') APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS = ('Slate', 'Synergy', 'iTerm')
@ctask @ctask
def enable_access_for_assistive_devices(ctx): def access_for_assistive_devices(ctx):
for app in APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS: for app in APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS:
app_string = '/Applications/{0}.app'.format(app) app_string = '/Applications/{0}.app'.format(app)
user_application = os.path.expanduser('~' + app_string) user_application = os.path.expanduser('~' + app_string)
enable_access_if_exists(ctx, user_application) access_if_exists(ctx, user_application)
enable_access_if_exists(ctx, app_string) access_if_exists(ctx, app_string)
enable_access_if_exists( access_if_exists(
ctx, ctx,
"/Applications/Karabiner.app/Contents/Applications/Karabiner_AXNotifier.app" "/Applications/Karabiner.app/Contents/Applications/"
"Karabiner_AXNotifier.app"
) )
def enable_access_if_exists(ctx, app_string): def access_if_exists(ctx, app_string):
if os.path.exists(app_string): if os.path.exists(app_string):
ctx.run( ctx.run(
'zsh -c "source ~/.zshrc && ' 'zsh -c "source ~/.zshrc && '
@ -127,9 +86,11 @@ def enable_access_if_exists(ctx, app_string):
) )
@ctask @ctask
def enable_hyper(ctx): def hyper(ctx):
source = '{0}/karabiner-hyper.xml'.format(util.RESOURCES_DIRECTORY) source = '{0}/karabiner-hyper.xml'.format(util.RESOURCES_DIRECTORY)
destination = os.path.expanduser("~/Library/Application\\ Support/Karabiner/private.xml") destination = os.path.expanduser(
"~/Library/Application\\ Support/Karabiner/private.xml"
)
try: try:
ctx.run("rm {0}".format(destination)) ctx.run("rm {0}".format(destination))
except: except:
@ -139,21 +100,24 @@ def enable_hyper(ctx):
@ctask @ctask
def enable_locate(ctx): def locate(ctx):
ctx.run('sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist') ctx.run('sudo launchctl load -w '
'/System/Library/LaunchDaemons/com.apple.locate.plist')
@ctask @ctask
def install_rvm(ctx): def install_rvm(ctx):
ctx.run('\curl -sSL https://get.rvm.io | bash -s stable') ctx.run('\\curl -sSL https://get.rvm.io | bash -s stable')
@ctask @ctask
def install_powerline_monaco(ctx): def install_powerline_monaco(ctx):
ctx.run('open {0}'.format(os.path.join(util.RESOURCES_DIRECTORY, "Monaco-Powerline.otf"))) ctx.run('open {0}'.format(
os.path.join(util.RESOURCES_DIRECTORY, "Monaco-Powerline.otf"))
)
@ctask @ctask
def get_command_line_tools(ctx): def cl_tools(ctx):
if not util.command_exists('gcc'): if not util.command_exists('gcc'):
ctx.run('xcode-select --install') ctx.run('xcode-select --install')