From cb10d2e72324af6fc5729c8e9912b9255f8f65a5 Mon Sep 17 00:00:00 2001 From: Bo Jeanes Date: Tue, 11 Aug 2015 17:54:41 +1000 Subject: [PATCH] Add Karabiner config --- Rakefile | 2 +- install.yml | 1 + karabiner-ref.xml | 4 ++ karabiner.xml | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 karabiner-ref.xml create mode 100644 karabiner.xml diff --git a/Rakefile b/Rakefile index b67fbb9..a20f1b0 100644 --- a/Rakefile +++ b/Rakefile @@ -16,5 +16,5 @@ task :install do plan = YAML.load_file(File.expand_path("install.yml", dot_files)) install.call plan[:link], %w[ln -sinF] - install.call plan[:copy], %w[cp -n] + install.call plan[:copy], %w[cp -i] end diff --git a/install.yml b/install.yml index b94ab1b..979dd4b 100644 --- a/install.yml +++ b/install.yml @@ -31,3 +31,4 @@ vcs/hg/hgrc: ~/.hgrc :copy: vcs/git/gitconfig.local: ~/.gitconfig.local + karabiner-ref.xml: ~/Library/Application Support/Karabiner/private.xml diff --git a/karabiner-ref.xml b/karabiner-ref.xml new file mode 100644 index 0000000..7ef15ae --- /dev/null +++ b/karabiner-ref.xml @@ -0,0 +1,4 @@ + + + + diff --git a/karabiner.xml b/karabiner.xml new file mode 100644 index 0000000..8c2560e --- /dev/null +++ b/karabiner.xml @@ -0,0 +1,112 @@ + + + YUBI_ENABLE + + + Ignore Yubikey key presses + Ideal for scenarios where you may accidentally touch the + Yubikey and output an unwanted code. This rule requires + double-pressing SHIFT_R, which enables the Yubikey for a + singe token output. + + In addition, it always allows the Yubikey to work if a text + field is in focus or if the current application is a terminal. + + private.yubikey_ignore + + + + __DoublePressModifier__ KeyCode::SHIFT_R, + + + KeyCode::SHIFT_R, + + + KeyCode::VK_LOCK_YUBI_ENABLE_FORCE_ON + + + + DeviceVendor::YUBICO + ModifierFlag::YUBI_ENABLE + + + TERMINAL + AXTextField + + __KeyToKey__ KeyCode::A, KeyCode::VK_NONE + __KeyToKey__ KeyCode::B, KeyCode::VK_NONE + __KeyToKey__ KeyCode::C, KeyCode::VK_NONE + __KeyToKey__ KeyCode::D, KeyCode::VK_NONE + __KeyToKey__ KeyCode::E, KeyCode::VK_NONE + __KeyToKey__ KeyCode::F, KeyCode::VK_NONE + __KeyToKey__ KeyCode::G, KeyCode::VK_NONE + __KeyToKey__ KeyCode::H, KeyCode::VK_NONE + __KeyToKey__ KeyCode::I, KeyCode::VK_NONE + __KeyToKey__ KeyCode::J, KeyCode::VK_NONE + __KeyToKey__ KeyCode::K, KeyCode::VK_NONE + __KeyToKey__ KeyCode::L, KeyCode::VK_NONE + __KeyToKey__ KeyCode::M, KeyCode::VK_NONE + __KeyToKey__ KeyCode::N, KeyCode::VK_NONE + __KeyToKey__ KeyCode::O, KeyCode::VK_NONE + __KeyToKey__ KeyCode::P, KeyCode::VK_NONE + __KeyToKey__ KeyCode::Q, KeyCode::VK_NONE + __KeyToKey__ KeyCode::R, KeyCode::VK_NONE + __KeyToKey__ KeyCode::S, KeyCode::VK_NONE + __KeyToKey__ KeyCode::T, KeyCode::VK_NONE + __KeyToKey__ KeyCode::U, KeyCode::VK_NONE + __KeyToKey__ KeyCode::V, KeyCode::VK_NONE + __KeyToKey__ KeyCode::W, KeyCode::VK_NONE + __KeyToKey__ KeyCode::X, KeyCode::VK_NONE + __KeyToKey__ KeyCode::Y, KeyCode::VK_NONE + __KeyToKey__ KeyCode::Z, KeyCode::VK_NONE + __KeyToKey__ KeyCode::SEMICOLON, KeyCode::VK_NONE + __KeyToKey__ KeyCode::QUOTE, KeyCode::VK_NONE + __KeyToKey__ KeyCode::TAB, KeyCode::VK_NONE + __KeyToKey__ KeyCode::RETURN, KeyCode::VK_NONE + __KeyToKey__ KeyCode::SPACE, KeyCode::VK_NONE + + + + DeviceVendor::YUBICO + ModifierFlag::YUBI_ENABLE + + + + __KeyToKey__ KeyCode::RETURN, KeyCode::RETURN, + + Option::KEYTOKEY_AFTER_KEYUP, KeyCode::VK_LOCK_YUBI_ENABLE_FORCE_OFF + + + + + + COLEMAK + com.apple.keylayout.Colemak + + + + Yubikey from Colemak to QWERTY + If the system layout is set to Colemak, remap the Yubikey + back to QWERTY so that the tokens are correct. + private.yubikey_colemak_qwerty + DeviceVendor::YUBICO + COLEMAK + __KeyToKey__ KeyCode::F, KeyCode::E + __KeyToKey__ KeyCode::P, KeyCode::R + __KeyToKey__ KeyCode::G, KeyCode::T + __KeyToKey__ KeyCode::J, KeyCode::Y + __KeyToKey__ KeyCode::L, KeyCode::U + __KeyToKey__ KeyCode::U, KeyCode::I + __KeyToKey__ KeyCode::Y, KeyCode::O + __KeyToKey__ KeyCode::SEMICOLON, KeyCode::P + __KeyToKey__ KeyCode::R, KeyCode::S + __KeyToKey__ KeyCode::S, KeyCode::D + __KeyToKey__ KeyCode::T, KeyCode::F + __KeyToKey__ KeyCode::D, KeyCode::G + __KeyToKey__ KeyCode::N, KeyCode::J + __KeyToKey__ KeyCode::E, KeyCode::K + __KeyToKey__ KeyCode::I, KeyCode::L + __KeyToKey__ KeyCode::O, KeyCode::SEMICOLON + __KeyToKey__ KeyCode::K, KeyCode::N + +