From 7988eb7f6a5bb34a6ec5e7b831bb3c7937d66775 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 23 Oct 2014 03:42:35 -0700 Subject: [PATCH] slate.js --- dotfiles/emacs.d | 2 +- dotfiles/lib/shellrc/functions.sh | 12 ++++++------ dotfiles/slate.js | 17 +++++++++++++++++ tasks/osx.py | 2 +- 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 dotfiles/slate.js diff --git a/dotfiles/emacs.d b/dotfiles/emacs.d index af089b24..cfc45035 160000 --- a/dotfiles/emacs.d +++ b/dotfiles/emacs.d @@ -1 +1 @@ -Subproject commit af089b245a9b18bc6cd005260dcf4cd60fe51cd7 +Subproject commit cfc45035ac58e9713f8dc9bf7d75a95e79111307 diff --git a/dotfiles/lib/shellrc/functions.sh b/dotfiles/lib/shellrc/functions.sh index bf33beeb..3daac88c 100644 --- a/dotfiles/lib/shellrc/functions.sh +++ b/dotfiles/lib/shellrc/functions.sh @@ -208,15 +208,15 @@ function pip_package_location() { } function set_modifier_keys_for_vendor_product_id() { - defaults -currentHost write -g com.apple.keyboard.modifiermapping.$1-0 '( -{ - HIDKeyboardModifierMappingDst = 2; - HIDKeyboardModifierMappingSrc = 0; -})' + local mapping="HIDKeyboardModifierMappingDst$3HIDKeyboardModifierMappingSrc$2" + echo $mapping + defaults -currentHost write -g com.apple.keyboard.modifiermapping.$1-0 -array-add "$mapping" } function set_modifier_keys_on_all_keyboards() { - for vendor_product_id in $(get_keyboard_vendor_id_product_id_pairs | tr " " "-"); do set_modifier_keys_for_vendor_product_id $vendor_product_id; echo $vendor_product_id; done; + for vendor_product_id in $(get_keyboard_vendor_id_product_id_pairs | tr " " "-"); do + set_modifier_keys_for_vendor_product_id $vendor_product_id 0 2; echo $vendor_product_id; + done; } function get_keyboard_vendor_id_product_id_pairs() { diff --git a/dotfiles/slate.js b/dotfiles/slate.js new file mode 100644 index 00000000..17672e39 --- /dev/null +++ b/dotfiles/slate.js @@ -0,0 +1,17 @@ +var hint = slate.op("hint", { + "characters" : "ASDFGHJKLQWERTYUIOPCVBN" +}); +var grid = slate.op("grid", { + grids: { + "1920x1080": {"width": 8, "height": 6} + } +}); +slate.bindAll({ + "esc:cmd": hint, + "space:alt": grid +}); +slate.configAll({ + windowHintsIgnoreHiddenWindows: false, + windowHintsShowIcons: true, + windowHintsSpread: true +}); \ No newline at end of file diff --git a/tasks/osx.py b/tasks/osx.py index 2b3e230f..7a1e659b 100644 --- a/tasks/osx.py +++ b/tasks/osx.py @@ -35,7 +35,7 @@ MISC = ("file-formula", "less", "openssh --with-brewed-openssl", "perl518", "rsync", "svn", "unzip", "docker", "boot2docker", "pandoc", "mercurial") CASKS = ('caffeine', 'flux', 'google-chrome', 'iterm2', 'spotify', - 'vlc', 'virtualbox', 'xquartz', 'synergy', 'slate') + 'vlc', 'virtualbox', 'xquartz', 'synergy', 'slate', 'seil') @ctask