All Projects → DavRack → Skr

DavRack / Skr

Licence: gpl-3.0
Low level key re-programming

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Skr

Typist
Swift UIKit keyboard manager for iOS apps.
Stars: ✭ 1,011 (+2051.06%)
Mutual labels:  keyboard, keyboard-layout
keymacs
Ergonomic keyboard layout for nonergonomic keyboards.
Stars: ✭ 22 (-53.19%)
Mutual labels:  keyboard, keyboard-layout
kinesis-advantage-2
Keyboard layouts and macros for the Kinesis Advantage 2 keyboard.
Stars: ✭ 72 (+53.19%)
Mutual labels:  keyboard, keyboard-layout
Ergodox Layout
algernon's ErgoDox EZ layout
Stars: ✭ 135 (+187.23%)
Mutual labels:  keyboard, keyboard-layout
kalamine
Keyboard Layout Maker
Stars: ✭ 47 (+0%)
Mutual labels:  keyboard, keyboard-layout
Keyboard Layout Editor For Blender
Allows you to import keyboard layouts into blender and render them in 3d
Stars: ✭ 224 (+376.6%)
Mutual labels:  keyboard, keyboard-layout
keyd
A key remapping daemon for linux.
Stars: ✭ 687 (+1361.7%)
Mutual labels:  keyboard, keyboard-layout
Awesome Mechanical Keyboard
⌨️ A curated list of Open Source Mechanical Keyboard resources.
Stars: ✭ 1,294 (+2653.19%)
Mutual labels:  keyboard, keyboard-layout
Juni
12 Keys Chorded keyboard layout
Stars: ✭ 51 (+8.51%)
Mutual labels:  keyboard, keyboard-layout
GKey
German Keyboard Layout for TempleOS
Stars: ✭ 20 (-57.45%)
Mutual labels:  keyboard, keyboard-layout
Norman
Norman keyboard layout - alternative to QWERTY for touch typing in English
Stars: ✭ 112 (+138.3%)
Mutual labels:  keyboard, keyboard-layout
Gainput
Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
Stars: ✭ 636 (+1253.19%)
Mutual labels:  keyboard, low-level
Kll
KLL Compiler
Stars: ✭ 105 (+123.4%)
Mutual labels:  keyboard, keyboard-layout
react-material-ui-keyboard
Virtual keyboard for TextField when needed
Stars: ✭ 54 (+14.89%)
Mutual labels:  keyboard, keyboard-layout
Bigbagkbdtrixxkb
"DreymaR's Big Bag of Keyboard Tricks" for *nix with XKB
Stars: ✭ 95 (+102.13%)
Mutual labels:  keyboard, keyboard-layout
keyboard-layouter
Footprint auto placement plugin for keyboard layout
Stars: ✭ 73 (+55.32%)
Mutual labels:  keyboard, keyboard-layout
Qwerty Lafayette
QWERTY keyboard layout for French-speaking users
Stars: ✭ 60 (+27.66%)
Mutual labels:  keyboard, keyboard-layout
Fx Experience
fx-experience -> fx onscreen keyboard
Stars: ✭ 72 (+53.19%)
Mutual labels:  keyboard, keyboard-layout
CustomKeyboard
A simple and fast implementation of a custom numeric keypad. There is always a keyboard for you.
Stars: ✭ 20 (-57.45%)
Mutual labels:  keyboard, keyboard-layout
Vue Touch Keyboard
Virtual keyboard component for Vue.js 2.x. Designed to Raspberry Pi Touch Display
Stars: ✭ 255 (+442.55%)
Mutual labels:  keyboard, keyboard-layout

Simple Key Remap

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

  • 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
  • Multiple keyboard support

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

Installation

Arch Linux

Install skr from the aur with the package skr-git

example using yay AUR helper

yay -S skr-git

Ubuntu 20.04

First install interception-tools and git

sudo apt install git libudev-dev libevdev-dev libyaml-cpp-dev cmake build-essential
git clone https://gitlab.com/interception/linux/tools.git
cd tools
mkdir build
cd build
cmake ..
make
sudo make install
cd

Install skr

git clone https://github.com/DavRack/skr.git
cd skr
./install.sh

Fedora 32

First install interception-tools and git

sudo dnf install git cmake yaml-cpp-devel libevdev-devel systemd-devel gcc-c++ @development-tools
git clone https://gitlab.com/interception/linux/tools.git
cd tools
mkdir build
cd build
cmake ..
make
sudo make install
cd

Install skr

git clone https://github.com/DavRack/skr.git
cd skr
./install.sh

Uninstall skr

./install.sh -u

Configuration

SKR is configured through ~/.config/skr/skr.config. You can find an example config file here

Once skr is installed, run:

skr --init

This command will prompt you to press a key. skr will find the path 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 for skr to intercept:

if you ran skr --init, the keyboard path will have already been defined

KeyboardPath -> /dev/input/event3

Key remap

A key remap makes a key behave like it is another. It uses the following syntax:

[keyToRemap] -> [targetKey]

Example: Remap CapsLock to Esc

CapsLock -> Esc

skr takes its key names from /usr/include/linux/input-event-codes.h

Here's a key code table with all valid key names: keycode table

Key swap

A key swap remaps two keys to each other. It uses the following syntax:

[Key1] <-> [Key2]

This is equivalent to the following remaps

[Key1] -> [Key2]

[Key2] -> [Key1]

Example: Swap Meta/Super ("Windows" key) with left alt:

META <-> ALT

Scripts

SKR can map a key to a script or shell command. It uses the following syntax:

[KeyToRemap] -> Script=[your command or full path to a script]

Example: log memory usage to a file located in /tmp/memlog

[KeyToRemap] -> Script=free -h > /tmp/memlog

Warning! all commands launched from skr will be executed as root

Layers

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 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:

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

    # remap 1

    # remap 2
    .
    .
    .


# you can define multiple layers
NewLayer -> [fnKey2]
    # all remaps after NewLayer will activate when [fnKey2] is hold down

    # remap 1

    # remap 2
    .
    .
    .

The HJKL example would be written like this:

NewLayer -> CapsLock

    H -> LEFT
    J -> DOWN
    K -> UP
    L -> RIGHT
Some things to keep in mind about layers
  • 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

Auto start (systemd)

To run skr on boot first we need to create a unit file at /etc/systemd/system/[email protected] with the following content:

[Unit]
Description=Low-Level key remapping

[Service]
User=root
Environment=USER=root
Environment=SUDO_USER=%i
ExecStart=/usr/bin/skr

[Install]
WantedBy=multi-user.target

Then enable the unit by running:

replace your username where indicated

sudo systemctl enable [email protected]

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

sudo systemctl enable --now [email protected]

Dependencies

Donations

If you like my work you can send me crypto using these wallets:

BTC: 17u6NAodc6GrQPRGNy92xF6pmzDFaq2EuC

ETH: 0xa85c356d396A80Afc49B6B281E4a9a897fdfa152

TODO

  • MD custom macros
  • Don't run non sudo commands as root
  • Remove dependencies
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].