Skip to content

Commit

Permalink
Merge pull request #10 from aaronamk/master
Browse files Browse the repository at this point in the history
Edited for grammar.
  • Loading branch information
DavRack authored Dec 14, 2020
2 parents 70fad82 + af5087e commit 16c58d2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 39 deletions.
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

SKR is a low level, low latency way to remap keys. Some of the features of **SKR** are:

+ Remap keys to other keys
+ Remap keys to shell commands or scripts
+ Remap keys
+ Remap keys to run a shell command or script
+ Remap keys to run a sequences of keys, commands, and scripts (A.K.A Macro) (needs documentation but it's there)
+ Function Layers
+ Remap keys to sequences of keys, commands and scripts (A.K.A Macros) (needs to be documented but it's there)
+ Multiple keyboard support

SKR sits very low in the keyboard stack just above the kernel so its
independent of desktop environments, window manager or graphical environments
in general, even works in tty.
SKR sits very low in the keyboard stack just above the kernel. Thus, it is
independent of display protocol, desktop environment, or window manager.
It even works in tty.

### Table of Contents

Expand Down Expand Up @@ -94,10 +94,10 @@ cd skr

## Configuration

> SKR is configured through **~/.config/skr/skr.config** you can find an
> SKR is configured through **~/.config/skr/skr.config**. You can find an
example config file [here](docs/exampleConfig.txt)

Once skr is installed run:
Once skr is installed, run:

```shell
skr --init
Expand All @@ -108,17 +108,17 @@ of the keyboard used to press the key and will create a config file

### Editing the config file

First we need to define the keyboard path that skr will intercept:
First we need to define the keyboard path for skr to intercept:

> if you run **skr --init** the keyboard path will be already defined
> if you ran **skr --init**, the keyboard path will have already been defined
```conf
KeyboardPath -> /dev/input/event3
```

#### Key remap

A key remap takes one key and convert its to another key and has this syntax:
A key remap makes a key behave like it is another. It uses the following syntax:

```conf
[keyToRemap] -> [targetKey]
Expand All @@ -136,13 +136,13 @@ Here's a key code table with all valid key names: [keycode table](docs/keyCodes.

#### Key swap

A Key Swap the function of two keys and has this syntax:
A key swap remaps two keys to each other. It uses the following syntax:

```conf
[Key1] <-> [Key2]
```

A key swap its equivalent to two remaps
This is equivalent to the following remaps

```conf
[Key1] -> [Key2]
Expand All @@ -159,7 +159,7 @@ META <-> ALT

#### Scripts

SKR can use any key to launch a script or shell command and has this syntax:
SKR can map a key to a script or shell command. It uses the following syntax:

```conf
[KeyToRemap] -> Script=[your command or full path to a script]
Expand All @@ -175,20 +175,19 @@ Example: log memory usage to a file located in /tmp/memlog

#### Layers

A Layer is a set of additional key bindings achieved by
holding down a predefined key on the keyboard, its easier to understand
with an example:
A layer is a set of additional key bindings that can be reached by holding down
a key. It is easier to understand with an example:

Let's say you want to use **H J K L** as arrow keys (vim style), you can set
capsLock as a fnKey
so when you hold it down and press H,J,K or L this keys will act as arrow keys,
but when the fnKey is not press **H J K L** will work normally.
Let's say you want to use **H J K L** as arrow keys (vim style). You can use
capsLock as your fnKey
When you hold it down and press H, J, K, or L they will act as arrow keys.
When the fnKey is not held, **H J K L** will work normally.

The syntax for layers is:

```shell
NewLayer -> [fnKey]
# all remaps after NewLayer will activate when [fnKey] is hold down
# all remaps after NewLayer will only activate when [fnKey] is held down

# remap 1

Expand All @@ -210,7 +209,7 @@ NewLayer -> [fnKey2]
.
```

The H J K L as arrows example would look like this on the config file:
The HJKL example would be written like this:

```shell
NewLayer -> CapsLock
Expand All @@ -223,9 +222,9 @@ NewLayer -> CapsLock

##### Some things to keep in mind about layers

+ When a Layer is defined its function key stops working as a normal key
+ When a Layer is defined, its function key stops working as a normal key

+ You can define anything inside a layer: Remaps, Scripts and Macros
+ You can define anything inside a layer: remaps, scripts, and macros

## Auto start (systemd)

Expand All @@ -247,13 +246,13 @@ ExecStart=/usr/bin/skr
WantedBy=multi-user.target
```

Then enable the unit running:
Then enable the unit by running:

```shell
sudo systemctl enable skr.service
```

this will start the service at boot. to start skr imediatly run:
This will start the service at boot. To start skr immediately, run:

```shell
sudo systemctl start skr.service
Expand All @@ -265,7 +264,7 @@ sudo systemctl start skr.service
+ sudo

# Donations
if you like my work you can send me crypto to these wallets:
If you like my work you can send me crypto using these wallets:

**BTC: 17u6NAodc6GrQPRGNy92xF6pmzDFaq2EuC**

Expand Down
20 changes: 9 additions & 11 deletions docs/exampleConfig.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# The path of my laptop leyboard
# if available /dev/input/by-id paths are prefered becouse that paths dont change after reboot
# path to laptop keyboard
# if available, use a path under /dev/input/by-id, so it won't change after reboot
KeyboardPath -> /dev/input/event3

KeyboardPath->/dev/input/event3

# remap Tab to Esc
# remap tab to esc
TAB -> ESC

# swap super and right alt
# swap super with right alt
META <-> ALT

# Define a new fnLayer using capsLock as fnKey
NewLayer->CapsLock
# Define a new fnLayer using caps lock as fnKey
NewLayer -> CapsLock

SPACE -> TAB

Expand All @@ -21,11 +20,10 @@ NewLayer->CapsLock
L -> RIGHT

# launch ST terminal with the T key
# using "&" at the end of the command will prevent the app for clossing if skr is stoped

# adding "&" to the end will prevent the app from closing if skr is stopped
T -> Script=st&

# if you want modifiers inside a layer simply remap them to themselves (or any other key)
# if you want a modifier inside a layer simply remap it to itself (or any other key)
LEFTCTRL -> LEFTCTRL
RIGHTCTRL -> RIGHTCTRL
LEFTSHIFT -> LEFTSHIFT
Expand Down

0 comments on commit 16c58d2

Please sign in to comment.