Skip to content

Commit

Permalink
added install script
Browse files Browse the repository at this point in the history
  • Loading branch information
DavRack committed Jun 7, 2020
1 parent d84527b commit 1fa70da
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 20 deletions.
66 changes: 58 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,74 @@
# skr
<h1 align="center"> Simple Key Remap </h1>

*ALPHA!*
### Introduction

una piesa de software que permite:
SKR is a low level, low latency way to remap keys to:

+ Remapear teclas
+ Lanzar comandos shell con una combinación de teclas
+ Crear capas
+ Other keys
+ Shell commands or scripts
+ Secuences of keys and/or commands/scripts
+ Function Layers

[Tabla de keyCodes](docs/keyCodes.md)

## Limitaciones
### Instalation

```shell
mkdir skr
cd skr
git clone https://github.com/DavRack/skr.git
```

### Examples

> Create the config file at: ~/.config/skr/skr.config
Remap CapsLock to Esc

```vim
CapsLock -> Esc
```

or with explicit keyCodes

```vim
KeyCode(58) -> KeyCode(58)
```

Swap Meta ("Windows" key) with left alt

```vim
META <-> ALT
```

Remap H,J,K,L to left, down, up and right arrow keys (like vim) using
CapsLock as fnLayer

> when a fnLayer is defined it's fnKey will **only** work as fnKey
```vim
NewLayer -> CapsLock
H -> LEFT
J -> DOWN
K -> UP
L -> RIGHT
```

### Limitaciones

Si bien skr permite combinaciones de hasta 8 teclas,
el ["Key Rollover"](https://en.wikipedia.org/wiki/Rollover_%28key%29) del teclado
puede limitar el número máximo de teclas reconocidas al mismo tiempo.

Nota: Este software fue probado en ArchLinux con kernel 5.6.6-arch1-1

## Dependencias
### Dependencias

[interception-tools](https://gitlab.com/interception/linux/tools)

### todo

+ md install
+ md custom macros
+ dont run non sudo commands as root

11 changes: 0 additions & 11 deletions build.sh

This file was deleted.

32 changes: 32 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

install(){
gcc src/core/main.c -o skr

sudo mkdir -p /usr/share/skr
sudo cp -r src/parser /usr/share/skr

sudo cp skr /usr/bin/
}
uninstall(){
sudo rm -rf /usr/share/skr
sudo rm /usr/bin/skr
}
usage(){
echo usage:
echo " "
echo " ./install.sh installs skr"
echo " ./install.sh -u uninstalls skr"
}

if [ "$#" = "0" ];then
echo installing skr
install

elif [ "$1" = "-u" ];then
echo uninstalling skr
uninstall

else
usage
fi
2 changes: 1 addition & 1 deletion src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
int main(){
//se usa el comando intercept para obtener los eventos
//generados por el teclado
FILE *configFile = popen("python3 src/parser/parser.py","r");
FILE *configFile = popen("python3 /usr/share/skr/parser/parser.py","r");
parseConfigFromFile(configFile);

// generate shell commands to interact with interception-tools
Expand Down

0 comments on commit 1fa70da

Please sign in to comment.