https://github.com/uphy/karabiner-config
Karabiner Config File Generator
https://github.com/uphy/karabiner-config
Last synced: 4 months ago
JSON representation
Karabiner Config File Generator
- Host: GitHub
- URL: https://github.com/uphy/karabiner-config
- Owner: uphy
- Created: 2020-04-05T09:15:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-27T13:14:33.000Z (over 3 years ago)
- Last Synced: 2024-06-20T17:52:22.157Z (about 2 years ago)
- Language: Go
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# karabiner-config
Generate karabiner-Elements configuration file with simple syntax.

[karabiner-Elements](https://github.com/tekezo/Karabiner) is a great keyboard customization tool but its configuration file is a little redundant and hard to maintain.
`karabiner-config` generates the configuration file from more simple and readable configuration file.
- YAML format
- Commonize conditions between multiple manipulators (e.g., `frontmost_application_if`, `frontmost_application_unless`)
- Shorten frequently used configurations
- Set variable
- Condition based on variable
- Condition based on frontmost application
- In `manipulator` configuration switch
- Delayed `to`
- Tag-based manipulator management
## Installation
### Binary
See [release](https://github.com/uphy/karabiner-config/releases) page.
### Build
```sh
$ git clone https://github.com/uphy/karabiner-config
$ cd karabiner-config
$ make install
```
## Getting Started
Create new rule file.
This example defines keybinding `Control-m` to start a new line.
`sample/instruction/01_c-m.yml`
```yaml
title: Control+M to newline
maintainers:
- uphy
rules:
- description: Control+H to newline
manipulators:
- from:
key: C-m
to:
- key: return_or_enter
```
Then import this rule to the existing karabiner config.
**Note**: This command replaces your karabiner config's `Default profile` directly. Please back up first.
```sh
$ karabiner-config sample/instruction/01_c-m.yml ~/.config/karabiner/karabiner.json
```
Also you can watch changes of the yaml file and automatically update the karabiner config with `-w` option.
```sh
$ karabiner-config -w sample/instruction/01_c-m.yml ~/.config/karabiner/karabiner.json
```
In the terminal, most of shell supports the `Control-m` by default.
So, disable the keybinding.
`sample/instruction/01_c-m.yml`
```diff
- from:
key: C-m
to:
- key: return_or_enter
+ conditions:
+ - app_unless:
+ identifiers:
+ - ^com\\.apple\\.Terminal$
```
After save this rule file, your karabiner config will be automatically updated.
## Rule file
The rule file structure is same as Karabiner-Elements.
But there are some improvements.
### YAML format
### Commonize conditions between multiple manipulators
### Shorten frequently used configurations
#### Keybindings
#### Set variable
#### Condition based on variable
#### Condition based on frontmost application
### In `manipulator` configuration switch
### Delayed `to`
### Tag-based manipulator management