Jump to content

A way to boost your productivity with Karabiner


Recommended Posts

This is not necessarily a workflow I am sharing but something I use that I love and would really love to share with you. It allows me to use and manipulate all the great workflows you kind people have created and share and use them seamlessly. It also allows me to spike up my usage stats by some pretty wild numbers : 

 

9vUkV8Y.png

 

The reason is that I don't ever really activate anything using hotkeys any more. I use something called 'sticky keys' and I have achieved using Karabiner. [Here](https://github.com/nikitavoloboev/dotfiles/tree/master/karabiner) is my repository with my config file for Karabiner. I have also put a readme in there to show how I use it and what for. You can just clone the repository and use the settings and change them to what you consider best for you.

 

I hope you will like it too. Tell me what you think of it and if you managed to get it to work. You can ask any question you have about the config file I have as it is pretty lengthy.

 

Link to comment

geez I been using Karabiner for a long time after reading "A Modern Space Cadet" but never realize there is launcher mode.... its amazing. here is the blog post link... I think people need to read it 1st to appreciate and understand your tweak.

 

https://stevelosh.com/blog/2012/10/a-modern-space-cadet/

 

some of the highlight from the post are

 

- "hyper key" (which is cmd  + alt + opt + shift) and bind it to like CAP key. this way you can create a new layer of hotkey and wont shadow any system or any app hotkey. very useful to use with Alfred or Keyboard Maestro

 

- "dual role key" which make all modifier key have more than 1 role. example "shift key" when tap act as "(" and when hold act as "shift" (useful for coding, I made all my modifier key to type all the left bracket such as ( { < [,  the editor will auto complete the right side.)

 

its a fantastic blog for starting out geeking with  keyboard workflow.

 

thank for sharing... now I gonna go refine my workflow... goodbye real work lol

Link to comment

        @begin
        KeyCode::VK_CONFIG_SYNC_KEYDOWNUP_notsave_launcher_mode_v2, ModifierFlag::LAUNCHER_MODE_V2,
        @end

 

that is from the original xml come with Karabiner, you modified it, I am wondering what does it do ? I tried to modify it but it keep run the default setting. Not from my private xml setting. I am thinking the bug has to do with those codes  thanks

 

------- answered my own question after some Googling -------

 

https://github.com/tekezo/Files/blob/master/Karabiner/private.launcher_mode_example/private.xml

Edited by dunkaroo
Link to comment

I was reading your xml file saw that you use hotkey to open apps but you can actually define open apps or script in a much cleaner way

 

for example:

<!-- Define your apps to run -->

<vkopenurldef>
  <name>KeyCode::VK_OPEN_URL_APP_XCODE</name>
  <url type="file">/Applications/xcode.app</url>
</vkopenurldef>

<!-- Define your script to run -->

  <vkopenurldef>
    <name>KeyCode::VK_OPEN_URL_SHELL_toggle_bluetooth</name>
    <url type="shell">
      <![CDATA[
        /usr/bin/osascript -e 'display notification "Toggle Bluetooth" with title "Karabiner"';
        /Applications/Karabiner.app/Contents/Library/vendor/bin/blueutil toggle
      ]]>
    </url>
  </vkopenurldef>

 

then call it with

 

   <autogen>
    __KeyDownUpToKey__
    KeyCode::X,
    KeyCode::VK_OPEN_URL_APP_XCODE,
  </autogen>

 

in <item>

 

this way you don't need to set it up with hotkey to trigger by Alfred or Keyboard Maestro, save you lots available extra hotkey.

 

Right now my one of my fav tweak after reading your post is

 

hold down "O" tap "D" for open finder, "D" stand for "directory"

then with hold down "O" tap "D", "D" for open MyDocument folder (in my head I am reading "Open Directory Document")

also hold down "O" tap "D", "I" for open Download Inbox folder (in my head I am reading "Open Directory download Inbox")

..... etc for all my most used folder. Used to use Alfred My Fav Folder workflow for that but this is just much faster

 

thanks again for bring the idea up. : )

 

one other tweak I had with Karabiner is auto space after "," Just little tweak made my day on keyboard little better.

 

    <item>
      <name>Space after comma</name>
      <appendix>Space after comma</appendix>
      <identifier>space_after_comma</identifier>
          <autogen>__KeyToKey__

                  KeyCode::COMMA, ModifierFlag::NONE,

                          

                  KeyCode::COMMA, ModifierFlag::NONE,

                  KeyCode::SPACE, ModifierFlag::NONE

           </autogen>
    </item>

Link to comment

And this space after the comma thing is really neat, thank you for sharing. I am thinking of the cases though where it might backfire and where I don't actually need the space there but for now this is really great. Thank you again. :)

Link to comment

Speaking of double tapping a key after a sticky key is pressed, how do you do it?

I study from the included package example.

/Applications/Karabiner.app/Contents/Resources/include/checkbox/launcher_mode.xml

This is the example came with the app.

* Open Finder: O+F key

* Open Desktop by Finder: O+F,D key

* Open the home folder by Finder: O+F,F (press F twice)

<autogen>

__KeyToKey__

KeyCode::F,

KeyCode::VK_NONE,

Option::KEYTOKEY_DELAYED_ACTION,

KeyCode::VK_OPEN_URL_APP_Finder,

Option::KEYTOKEY_DELAYED_ACTION_CANCELED_BY, KeyCode::D,

KeyCode::VK_OPEN_URL_FILE_Desktop,

KeyCode::VK_KEYTOKEY_DELAYED_ACTION_DROP_EVENT,

Option::KEYTOKEY_DELAYED_ACTION_CANCELED_BY, KeyCode::F,

KeyCode::VK_OPEN_URL_FILE_Home,

KeyCode::VK_KEYTOKEY_DELAYED_ACTION_DROP_EVENT,

</autogen>

Be mindful that you will use "__KeyToKey__" here not "__KeyDownUpToKey__"

I just modify it to suit my need. as your pre app setting you can actually done with Karabiner

Document here. https://pqrs.org/osx/karabiner/xml.html.enscroll down to "Filter: Specify application"

You can define settings which are effective in specific applications only.

Add <only> or <not> to your <item>.

I am currently converting all my most use hotkey for each apps to the nature language method (sticky key mode), I used to use Alfred search menu workflow when I forget a hotkey but I just hate to use my brain to remember those stupid hotkey like cmd+opt+whatever key....

Example with that would be "S" for Select sticky mode

"S" then tap "W" for Select current Word.

"S" then tap "L" for Select current Line.

"S" then tap "T", "B" for Select To Beginning of line.

"S" then tap "T", "E" for Select To End of line.

"S" then tap "U" for extend selection Up a line

.....etc

"T" for Text edit sticky mode

"T" then tap "N" for jump to Next word.

"T" then tap "P" for jump to Previous word.

"T" then tap "I" for Indent current selection line.

....etc

Just wanna give people example this doesn't only limited to for coder working with text..

Think about it use "F" for Filter then tap "G" for "Gaussian Blur" in Photoshop ( you read "F"ilter "G"aussian blur ) so much more nature than those awkward hotkeys

I think this thread is taking space in the niche corner of the internet... let me push it even further. my to show you couple of my custom programmable mech keyboard...

1rcpUun.jpg

kCkAIV4.jpg

The bottom one is my daily driver. I remove the space bar row and push everything up one row, the idea behind it is my thumb can do more than just hitting the space bar.. anyone interested more about it can read more here

https://geekhack.org/index.php?topic=81939.msg2165157#msg2165157

alone with my custom key map. The keyboard is hardware programmed with TMK firmware. I did some modify after the post but the idea is the same. (Beauty of hardware program is I can use my keyboard with all the key map mod with me to other computer. But everything I do there can be done with Karaniner. It is such a powerful tool. Can't recommend enough take the time to set it up )

anyone who is still reading here... feel free to post any question. its good to push it out side the box to make the hardware to work for you not the other way around, sorry Admin hope we didn't side track too much : p

Edited by dunkaroo
Link to comment

This is a really great setup. I thought I was alone in making best use of my keyboard and disliking traditional hotkey combinations.

 

I've been thinking actually of getting a mechanical keyboard like the one you have in the above photo (which keyboard is that?). But one thing I am worried is that I have perfected my current setup down to memory and it would be quite difficult to transition between the two keyboards, I would need to map both of them every time I want to change something and it just seems like quite a hassle. 

 

Also, would you mind sharing your private.xml, I think it would be quite interesting to see. Thank you. 

Link to comment

The top keyboard is "plank keyboard" It comes in 3 different size. You can find more info on their website. The philosophy behind it is make thumb more useful also "home row is King".  The keyboard is fully hardware programmable. You can make it match your current keyboard layout so no new learning curve. They actually come with standard keyboard layout per-programmed. I just went crazy and redesign everything.

 

Official website

http://olkb.com/

Massdrop page (some useful explanation)

https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open

TMK firmware for programming the keyboard, you can check out the doc to see what it can do.

https://github.com/tmk/tmk_keyboard

 

You can also google image "plank keyboard" too see more images with different keycap set up.

 

If you spend a lots of time on the keyboard I would actually recommend Topre switch keyboard. Most mech keyboard you see on the market are Cherry MX switch which sound cheap and sandy feeling. Topre is from Japan. It sound and feel amazing. 3 brand to check out are HHKB (Happy Hacking KeyBoard), Realforce, and  Leopold

 

Topre sound example:

 

standard cherry vs Topre sound

 

The Topre signature "thunk" sound is something to crave for, make my daily typing so much enjoyable...sometimes I just type for the sake of the sound and feeling. It's like finger dancing on the could.

 

Yes this is a thing, "10 min HHKB pro2 Typing Sound ASMR"

 

mech keyboard has a thriving community out there, reddit is a good place to start. Its a rabbit hole I gotta warn you. : )

 

https://www.reddit.com/r/MechanicalKeyboards/new/

 

I am still mapping out my nature language hotkey workflow. once I get it done I will post a update here. happy hacking !

Edited by dunkaroo
Link to comment

I have a question. The code for "R" as sticky key, e.g., has the hotkey "L" which launches an app.

 

In the xml-code, it looks like this "R+L" really triggers another set of keys - namely "; + shft + alt". I assume then thats your Alfred hotkey to launch that app. But what´s the benefit of doing that way, compared to Karabiner´s built-in feature "VK_OPEN_URL_APP_appname"?

 

I understand that one can get more keys this way in some instances, like being able to use 0+cmd+opt e.g., but don´t see the benefit of not using Karabiner´s app launcher. So I guess there´s something I haven´t thought of.

 

In any case, a very fun discovery - thanks for that!

Link to comment

I mentioned the reason why I bind app opening to a hotkey here : 

Yeah it does save hotkey space this way. But the reason why assign open apps to hotkeys is because I want to have the hotkey two different actions whether the app is open or not. I can do this with KM like so : 

 

5nbdiBJ.png

 

 

In short, karabiner only allows you to open the app. I want to both open the app, and switch to previous all in the same hotkey.

Link to comment

Just a reminder, Karabiner won't work with the macOS sierra yet. Apple rewrite the keyboard the mouse input. It's a known issues to the author of Karabiner. He is working on the update which might take a while. Don't update to the new OS if you relay heavily on Karabiner. The new OS update only really added Siri to the OS which is not so important to me so not updating right away isn't much an issues for me.

Link to comment
  • 4 weeks later...

Do you guys change any of the "timings" in Karabiner? I´ve found this sticky key idea to be useful, but am struggling to find the right balance between typing text and hotkeys when it comes to timing. Atm I have the "Initial Modifier Wait" at 50ms, but I was wondering what you guys use?

 

Combined with workflows, this entire idea is brilliant though. I used to write in Alfred Prompt for almost everything, so this approach saves a lot of keystrokes.

Link to comment

I use the default timing that goes with setting 'BlockUntilKeyUp_' and never had the problem.

 

In fact, I now have every key, 'sticky', even space. :) 

 

I thought it would conflict with my vim leader key being space but it turns out not to be a problem once you get used to it. And yes, this is very very powerful and saves you a lot of keystrokes. I have my i stickied to insert various hard to reach symbols like (\$/|&<?*^..), writing markdown is a joy now.

Link to comment

As for sticky mode I prefer 2 key assign for trigger it. One for per app hotkey and one for global system commands. My keyboard layout is really different but if I am using normal layout I would most likely use "/" and "z" for easily pinky press which leave rest of the strong fingers to type rest of the character.  Those 2 keys are rare use so avoid how the "sticky key" alphabet character could show up when key is up instead when key press down ( just flow better on screen ), Also when I am typing fast I often smash 2 to 3 keys at the same time which will cause problem. I found being able to chain 2 character after the sticky key is enough, no need for the 1 character as an alphabet as well. There is no right way but YOUR way, use what ever make sense to you :)

 

this is my reply to nikivi on Karabiner github page, I think it's worth to share here. for readability and the limited number of hotkeys combo could be used.

 

skimming thru your XML, I am guessing you are assign a lots of hotkey to trigger "Keyboard Maestro" and "Alfred" workflow or opening apps, there is better way to do it without using a single hotkey too

to launch apps
https://pqrs.org/osx/karabiner/xml.html.en#vkopenurldef

to trigger "Keyboard Maestro" via applescript
https://www.keyboardmaestro.com/documentation/6/triggers.html
at the end of the page

tell application "Keyboard Maestro Engine"
  do script "[Name or UID of Your Macro]"
end tell

to trigger "Alfred" via applescript
https://www.alfredapp.com/help/workflows/triggers/external/

 

 

Edited by dunkaroo
Link to comment
13 hours ago, dunkaroo said:

As for sticky mode I prefer 2 key assign for trigger it. One for per app hotkey and one for global system commands. My keyboard layout is really different but if I am using normal layout I would most likely use "/" and "z" for easily pinky press which leave rest of the strong fingers to type rest of the character.  Those 2 keys are rare use so avoid how the "sticky key" alphabet character could show up when key is up instead when key press down ( just flow better on screen ), Also when I am typing fast I often smash 2 to 3 keys at the same time which will cause problem. I found being able to chain 2 character after the sticky key is enough, no need for the 1 character as an alphabet as well. There is no right way but YOUR way, use what ever make sense to you :)

 

this is my reply to nikivi on Karabiner github page, I think it's worth to share here. for readability and the limited number of hotkeys combo could be used.

 

skimming thru your XML, I am guessing you are assign a lots of hotkey to trigger "Keyboard Maestro" and "Alfred" workflow or opening apps, there is better way to do it without using a single hotkey too

to launch apps
https://pqrs.org/osx/karabiner/xml.html.en#vkopenurldef

to trigger "Keyboard Maestro" via applescript
https://www.keyboardmaestro.com/documentation/6/triggers.html
at the end of the page


tell application "Keyboard Maestro Engine"
  do script "[Name or UID of Your Macro]"
end tell

to trigger "Alfred" via applescript
https://www.alfredapp.com/help/workflows/triggers/external/

 

 

Have you upgraded to Sierra already? I am curious, does it already have launcher mode support?

Link to comment
  • 1 year later...

@nikivi Hi! 

 

All of this seems to be very interesting and save a lot of time. I used to use Karabiner in the past to remap one or two keys but have never been a heavy/super user of this  application.

Because of that I was at the same excited by the potential and frustrated because I didn't see how to start. 

 

I even downloaded your profile.xml file loaded it in Karabiner. Got an error line 42 unexpected =... That's how my incursion to height of productivity ended. 

 

Could you please elaborate what sticky keys are? They seem to not be supported anymore, so I couldn't tried this special feature.

I tried to make in work in Karabiner-Elements but as I have an azerty keyboard I couldn't even use the application as only qwerty keyboards are supported.

 

Karabiner-Elements 11.4.0

Mac OS X 10.12.6 (16G1114)

Link to comment

Hey @politicus

 

My Karabiner configuration is not supported on your macOS version. You have to use Karabiner Elements and I am not sure how my configuration translates to in there, if I did I would update my macOS.

 

Sticky keys are simply custom modifier keys I set up for myself. You can read more about it here. ? 

 

Also take a look here. Some people, shared their sticky key configuration that works in Karabiner Elements.

Edited by nikivi
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...