Coder Social home page Coder Social logo

karabiner's Introduction

@mxstbr's Karabiner Elements configuration

If you like TypeScript and want your Karabiner configuration maintainable & type-safe, you probably want to use the custom configuration DSL / generator I created in rules.ts and utils.ts!

“This repo is incredible - thanks so much for putting it together! I always avoided Karabiner mostly because of its complicated configuration. Your project makes it so much easier to work with and so much more powerful. I'm geeking out on how much faster I'm going to be now.

— @jhanstra (source)

Watch the video about this repo:

CleanShot 2024-04-17 at 17 47 16@2x

Watch my interview with Raycast for a deeper dive into how I connect this with Raycast as my personal productivity system:

You probably don't want to use my exact configuration, as it's optimized for my personal style & usage. Best way to go about using this if you want to? Probably delete all the sublayers in rules.ts and add your own based on your own needs!

Installation

  1. Install & start Karabiner Elements
  2. Clone this repository
  3. Delete the default ~/.config/karabiner folder
  4. Create a symlink with ln -s ~/github/mxstbr/karabiner ~/.config (where ~/github/mxstbr/karabiner is your local path to where you cloned the repository)
  5. Restart karabiner_console_user_server with launchctl kickstart -k gui/`id -u`/org.pqrs.karabiner.karabiner_console_user_server

Development

yarn install

to install the dependencies. (one-time only)

yarn run build

builds the karabiner.json from the rules.ts.

yarn run watch

watches the TypeScript files and rebuilds whenever they change.

License

Copyright (c) 2022 Maximilian Stoiber, licensed under the MIT license.

karabiner's People

Contributors

brownymister avatar dferber90 avatar mxstbr avatar qnton avatar sachasmart avatar stasdeep 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

karabiner's Issues

Unable to switch capslock character

I am trying to toggle caps_lock using the § character. However, this only toggles is on and not off. How would I toggle if off using rules.ts. I looked into mapping non_us_backslash to locking_caps_lock but that didn't change anything. Thanks for the help! I've provided my rults.ts snippet.

  {
    description: "Change § to Caps Lock",
    manipulators: [
      {
        type: "basic",
        from: {
          key_code: "non_us_backslash",
        },
        to: [
          {
            key_code: "caps_lock",
          },
        ],
      },
    ],
  },

Add Mouse Pointer with Hyper + a (arrow pointer)+ {hjkl}

Hi,
It would be nice to add the mouse pointer movement to a sublayer.
Add Mouse Pointer with Hyper + a (arrow pointer)+ {hjkl}

I don't know if the mouse (up/down/left/right)(speed)/scroll up, variables are set

update
found mouse keys are just integers.
thanks

Caps lock won't work as hyper key

I downloaded the repository, and followed all of the instructions in the readme.md file. However, what I am wondering how to fix, is why the caps lock key will only work as escape, and not as the hyper key. I am aware that tapping it once will count as the escape key, but if I hold it, it does not activate the hyper key setup like it should. I also cannot add preconfigured extensions from the karabiner elements complex modifications website.

German Keybaord

Thanks for your great work and the wonderful presentation of it on the Raycast YouTube channel.

I got a little stuck. I am not super into TypeScript and JSON, so I might be missing something.

I tried to incorporate your rules.ts, etc. When I use the Hyper Key + o + z shortcut to open an app, Karabiner reads the German "z" as a "y," so I have to use the letter "y" in the rules.ts file to use my "z" key on the keyboard.
When using my keyboard normally, the layout matches what I see on the physical keyboard.

Is there a way to specify the keyboard layout in the rules.ts file, or is there an existing method to provide this information?

I am very grateful for any help.
Thanks.

README command

This is great stuff! just fyi - backticks in launch step are messing with markdown, could change to:

``launchctl kickstart -k gui/`id -u`/org.pqrs.karabiner.karabiner_console_user_server``

😇 Triggering application specific commands

Hi 👋🏻

I really liked you idea and want to add the same setup as yours with few changes.

I checked your script and found that We don't have per-app shortcuts/hotkeys that performs certain action for that application.

For example, If my foreground application is chrome and I want to duplicate the tab then I have menu command "Tab -> Duplicate tab" that duplicates the current tab. With the current implementation in this repo how can I trigger that menu command via sub layer key strokes. E.g. Pressing CAPS + C (_chrome_) + D should duplicate the current tab.

I would love to hear from you more automation related stuff from you.

Thanks for sharing ❤️

👍 Running Raycast extension action on background without popup

Hi
I really liked your idea and I want to bring some small lifehack.
So there is some deeplinks that you are opening with Raycast but it opens Raycast popup-> does the action -> closes popup. But it would be better to not show popup and just do the action.
So for that, just add to the end of the raycast deeplink ?launchType=background

For example I added shortcuts for Spotify Raycast extension:

c: {
  p: open("raycast://extensions/mattisssa/spotify-player/togglePlayPause?launchType=background"),
  n: open("raycast://extensions/mattisssa/spotify-player/next?launchType=background"),
  b: open("raycast://extensions/mattisssa/spotify-player/previous?launchType=background"),
},

and also I have separate shortcut for pause/resume foreground media, so in this way you can stop Spotify even if you are watching some video with shortcut.

Manual from Raycast docs.

Thanks for your repo and last video with guy from the Raycast🥳

w sublayer will not trigger

Is the w sublayer + semicolon functional for others?
Initially, I thought I had made a configuration error when customising my config. However, when I run master, it doesn't trigger. No keys are recorded when viewing karabiner event viewer.

What's strange, when using semicolon on the s sublayer, everything works as expected.

Question: Interaction with Rectangle

First off - man this is nice! Saves me a lot of time and makes the config much simpler!

I only have one problem that I can't seem to figure out: How to interact with Rectangle. I can see that you have implemented this already, but I cannot get it to work. Rectangle is installed and I can just the regular shortcuts to manipulate the windows. But I cannot get it to work using your script. The Logs in Rectangle and Karabiner-Elements do not give me any good clues about what is going on.

Any good advise about where to go from here?

/Kasper

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.