Code Monkey home page Code Monkey logo

hyper-hacks's Introduction

hyper-hacks

Here are my macOS Sierra hacks using some combination of Alfred 3, Karabiner-Elements, and Hammerspoon

Background:

When macOS Sierra hit, everyone using a Hyper key hack based off of Karabiner and Seil felt a deep loss.

This hack with Karabiner-Elements and Hammerspoon brings back that old-time hyper key feel, complete with ESCAPE binding.

Installation:

  • Install Hammerspoon

  • Install Karabiner-Elements

  • Put hammerspoon/init.lua in ~/.hammerspoon/init.lua

  • Put karabiner/karabiner.json in ~/.config/karabiner/karabiner.json

That’s pretty much it.

This is my first attempt and has a few examples in the init.lua. I aim to learn some more Lua and clean up the repetitious code.

In the meantime, check out the Wiki for ideas on how to configure your init.lua.

Reach out to me:

Github

@lodestone

Twitter

@lodestone

Email

[email protected]

hyper-hacks's People

Contributors

lodestone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyper-hacks's Issues

Performance isn't as good as hyper-key solution in original Karabiner/Seil

I am writing here in case there is a solution I missed. The provided configuration works as described, but my problem is that it is slow, or rather, it isn't as responsive as it used to be under with the original Karabiner.

If I quickly flick the capslock+character combination (e.g in the same speed I press the cmd+c) it has a 50% chance of registering correctly. To be sure I have to hold capslock down for about a second.

Is it something you're experiencing? Any ideas about a solution?

Here is my current configuration for reference:

-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")

passthrough = function(key)
  -- hs.alert.show("Config loaded: " .. key)
  k.triggered = true
  hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, key)
end

k:bind({}, 'c', nil, function() passthrough('c') end)
k:bind({}, 'f', nil, function() passthrough('f') end)
k:bind({}, 'e', nil, function() passthrough('e') end)
k:bind({}, 'p', nil, function() passthrough('p') end)
k:bind({}, '1', nil, function() passthrough('1') end)
k:bind({}, '2', nil, function() passthrough('2') end)
k:bind({}, '3', nil, function() passthrough('3') end)
k:bind({}, '4', nil, function() passthrough('4') end)
k:bind({}, '5', nil, function() passthrough('5') end)
k:bind({}, '6', nil, function() passthrough('6') end)
k:bind({}, '7', nil, function() passthrough('7') end)
k:bind({}, 'left', nil, function() passthrough('left') end)
k:bind({}, 'right', nil, function() passthrough('right') end)
k:bind({}, 'down', nil, function() passthrough('down') end)
k:bind({}, 'up', nil, function() passthrough('up') end)
k:bind({}, 'pagedown', nil, function() passthrough('pagedown') end)
k:bind({}, 'pageup', nil, function() passthrough('pageup') end)
k:bind({}, 'space', nil, function() passthrough('space') end)

ofun = function()
  hs.alert.show("Config loaded")
  hs.reload()
  k.triggered = true
end
k:bind({}, 'o', nil, ofun)

-- Enter Hyper Mode when F18 (Hyper/Capslock) is pressed
pressedF18 = function()
  k:enter()
  k.triggered = false
end

-- Leave Hyper Mode when F18 (Hyper/Capslock) is pressed
releasedF18 = function()
  k:exit()
  if not k.triggered then
    hs.eventtap.keyStroke({}, 'F19')
  end
end

-- Bind the Hyper key
hs.hotkey.bind({}, 'F18', pressedF18, releasedF18)

why bind to F17 instead of F18?

Hi.

I don't quite understand why you bind to the key F17 instead of F18 in here:
k = hs.hotkey.modal.new({}, "F17")

All the remaining in the init.lua file deals with F18.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.