Giter Site home page Giter Site logo

napisani / karabiner.ts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evan-liu/karabiner.ts

0.0 1.0 0.0 387 KB

Write Karabiner-Elements configuration in TypeScript

Home Page: https://evan-liu.github.io/karabiner.ts/

License: MIT License

JavaScript 0.10% TypeScript 99.90%

karabiner.ts's Introduction

karabiner.ts

License Coverage Status Wallaby.js npm deno module

Write Karabiner-Elements configuration in TypeScript.

Why karabiner.ts

karabiner.ts is heavily inspired by Goku. Compared to the edn format, it allows for:

  • Easier-to-understand TypeScript/JavaScript syntax
  • Strong-typed abstractions and key aliases with IDE support
  • Structured config files instead of one big file

Learn More

Usage with Node.js

npm

Option 1

npx create-karabiner-config@latest

The default directory name is karabiner-config. You can pass another project-name:

npx create-karabiner-config@latest [project-name]

Then:

  1. Write your key mapping in src/index.ts.
  2. Set the profile name. Create a new Karabiner-Elements profile if needed.
  3. Run npm run build.

To update to the latest version, run npm run update (or npm update karabiner.ts).

Option 2

  1. Download (or clone | fork) the examples/starter repo.
  2. Run npm install.

Then write and build the config same as Option 1.

Option 3

npm install karabiner.ts

(or install with yarn, pnpm, etc) then call writeToProfile() from any Node.js script in your preferred way.

Usage with Deno

deno module

In a Deno script file (replace {version}):

import { rule, writeToProfile } from 'https://deno.land/x/karabinerts@{version}/deno.ts'

writeToProfile('Default', [
  rule(...
])

Then run it with:

deno run --allow-env --allow-read --allow-write {filename}

karabiner.ts's People

Contributors

evan-liu avatar napisani avatar willpuckett avatar

Watchers

 avatar

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.