From 1def33eb6270437e5e8e97b642851089d71b6f0d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 23 Oct 2014 02:38:27 -0700 Subject: [PATCH] Added javascript, python requirements. pylinrc. Fixed pip directory in dotfiles, add enable_access_for_assitive devices and slate. remove alfred, divvy. --- dotfiles/.pip/pip.conf | 2 -- dotfiles/lib/shellrc/functions.sh | 15 +++++++++++++++ dotfiles/pylintrc | 2 ++ resources/npm.sh | 2 ++ resources/requirements.txt | 2 ++ tasks/osx.py | 23 ++++++++++++++++++++++- 6 files changed, 43 insertions(+), 3 deletions(-) delete mode 100644 dotfiles/.pip/pip.conf create mode 100644 dotfiles/pylintrc diff --git a/dotfiles/.pip/pip.conf b/dotfiles/.pip/pip.conf deleted file mode 100644 index 2f09f74b..00000000 --- a/dotfiles/.pip/pip.conf +++ /dev/null @@ -1,2 +0,0 @@ -[install] -download-cache = ~/.pip/download_cache \ No newline at end of file diff --git a/dotfiles/lib/shellrc/functions.sh b/dotfiles/lib/shellrc/functions.sh index e92c4f57..bf33beeb 100644 --- a/dotfiles/lib/shellrc/functions.sh +++ b/dotfiles/lib/shellrc/functions.sh @@ -293,3 +293,18 @@ function reload_root_agent { function ec { emacsclient -n $1 > /dev/null } + +function enable_access_for_assistive_devices { + local bundle_identifier=$(/usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' "$1/Contents/Info.plist") + local where_clause="where service='kTCCServiceAccessibility' and client='$bundle_identifier'" + local search_string="SELECT * from access ${where_clause};" + local values_string="VALUES('kTCCServiceAccessibility','$bundle_identifier',0,1,1,NULL)" + if test -z $(sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' $search_string); + then + local sql_string="INSERT INTO access $values_string;" + else + local sql_string="UPDATE access set allowed = 1 ${where_clause};" + fi + echo $sql_string + sudo sqlite3 '/Library/Application Support/com.apple.TCC/TCC.db' $sql_string +} diff --git a/dotfiles/pylintrc b/dotfiles/pylintrc new file mode 100644 index 00000000..5f17467f --- /dev/null +++ b/dotfiles/pylintrc @@ -0,0 +1,2 @@ +[MESSAGES CONTROL] +disable-msg=R0903 \ No newline at end of file diff --git a/resources/npm.sh b/resources/npm.sh index 8e3a4bc6..90d86faa 100644 --- a/resources/npm.sh +++ b/resources/npm.sh @@ -1,3 +1,5 @@ npm -g install http-server npm -g install js-beautify npm -g install tern +npm -g install jshint +npm -g install swank-js diff --git a/resources/requirements.txt b/resources/requirements.txt index 5fc145ec..68d5393b 100644 --- a/resources/requirements.txt +++ b/resources/requirements.txt @@ -12,3 +12,5 @@ dotfiles numpy readline Flask +flake8 +pylint diff --git a/tasks/osx.py b/tasks/osx.py index 7efc2940..2b3e230f 100644 --- a/tasks/osx.py +++ b/tasks/osx.py @@ -34,7 +34,8 @@ SHOULD_INSTALL = ( MISC = ("file-formula", "less", "openssh --with-brewed-openssl", "perl518", "rsync", "svn", "unzip", "docker", "boot2docker", "pandoc", "mercurial") -CASKS = ('alfred', 'caffeine', 'flux', 'google-chrome', 'iterm2', 'spotify', 'vlc', 'virtualbox', 'xquartz') +CASKS = ('caffeine', 'flux', 'google-chrome', 'iterm2', 'spotify', + 'vlc', 'virtualbox', 'xquartz', 'synergy', 'slate') @ctask @@ -78,6 +79,26 @@ def setup_cocoa_emacs(ctx): ctx.run('ln -s {0} {1}'.format(source, destination)) +APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS = ('Slate', 'Synergy', 'iTerm') +@ctask +def enable_access_for_assitive_devices(ctx): + for app in APPS_NEEDING_ASSISTIVE_DEVICE_ACCESS: + app_string = '/Applications/{0}.app'.format(app) + user_application = os.path.expanduser('~' + app_string) + if os.path.exists(user_application): + ctx.run( + 'source ~/.zshrc && ' + 'enable_access_for_assitive_devices "{0}"'.format( + user_application + ) + ) + + if os.path.exists(app_string): + ctx.run( + 'source ~/.zshrc && ' + 'enable_access_for_assitive_devices "{0}"'.format(app_string) + ) + @ctask def get_command_line_tools(ctx): if not command_exists('gcc'):