Git Product home page Git Product logo

ke-complex_modifications's Introduction

Build Status License

KE-complex_modifications

complex_modifications for Karabiner-Elements.

https://ke-complex-modifications.pqrs.org/

complex_modifications documents

How to add your rules

Follow the steps below to create a PR and add your settings!

  1. Fork this repository on GitHub.

  2. Clone the repository in Terminal.

    git clone --depth 1 https://github.com/{your_account}/KE-complex_modifications.git
    cd KE-complex_modifications
    git submodule update --init --recursive --depth 1
  3. Create a git branch in Terminal.

    git switch -c my-settings
  4. Put a JSON generator file (.js) into src/json. (Or put a .json file directly into public/json directory.)

  5. (Optional) Update public/groups.json if you want to add your rules to a particular category.

    Add the following entry into public/groups.json.

    {
        "path": "json/your_awesome_configuration.json", // required
        "extra_description_path": "extra_descriptions/your_awesome_configuration.html" // optional
    },
  6. Run make command in Terminal to validate your files.
    If you placed a generator file into src/json, json file will be generated in the public/json by this command.

    make

    If there is a problem, an error message is displayed. Fix your files until no errors are shown.

    "../public/json/personal_tekezo.json": `Personal rules (@tekezo) (rev 47)` error: `to` entry error: `key_code` error: unknown key_code: `"space"`
    make[1]: *** [all] Error 1
    make: *** [all] Error 2
    
  7. Test your files

    Copy a json file to ~/.config/karabiner/assets/complex_modifications.

    cp public/json/your_awesome_configuration.json ~/.config/karabiner/assets/complex_modifications

    Import rules from Karabiner-Elements Settings > Complex Modifications > Rules > Add rule.

  8. (Optional) Test your files on local web server.

    Run local web server by the following command in Terminal.

    make server

    Then open http://localhost:8000.

  9. Run git commit and git push in Terminal.

    git add -A
    git commit -m 'your commit message'
    git push --set-upstream origin my-settings
  10. Create a PR on GitHub.

Sync your fork

To update your previously forked repositories, run the following command in Terminal.

Run only once

git remote add upstream https://github.com/pqrs-org/KE-complex_modifications.git

Run every time

# switch to main branch
git switch main

# fetch upstream
git fetch --all --prune --prune-tags

# update local repository
git reset --hard upstream/main

# update submodules
git submodule update --init --recursive

# clean files
git clean -x -d -f .

# update GitHub repository
git push

Notes on creating your generators

The code in src/json/*.js is executed by Duktape, which is built into the Karabiner-Elements's command line interface ( karabiner_cli).

Unlike the latest Node.js, the basic language specification is ES5.1, so the following features cannot be used.

  • let (const is specially supported)
  • Arrow functions
  • Default parameters
  • Spread (...) syntax
  • Template literals

Examples

There are many existing codes. Here are some of the more distinctive ones among them.

ke-complex_modifications's People

Contributors

tekezo avatar apm1467 avatar suliveevil avatar marlonrichert avatar ccmvn avatar kamykaze avatar hi-hai avatar jeebak avatar jgosmann avatar mlewand avatar yqrashawn avatar bingocaller avatar thooams avatar harmtemolder avatar cnsunyour avatar flower7c3 avatar maxdzyubak avatar gsinti avatar annietma avatar alisonatwork avatar manabu0sec avatar dependabot[bot] avatar vinceau avatar paulchiu avatar varp avatar vonng avatar hesamshaelaie avatar ambv avatar toshi-ue avatar jjo 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.