bew / dotfiles

All my dotfiles in one place!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux keyboard daemon

bew opened this issue · comments

https://github.com/ItayGarin/ktrl
Written in rust, inspired by QMK but as a linux daemon

There is also Interception tools: https://gitlab.com/interception/linux/tools
This is more bare-bone, since it is a framework that makes it possible to implement tools like ktrl.
Verry flexible to do any kind of key manipulations, using a pipeline workflow:

# grab a device, change key y to z, then key x to y, then push back the
# event to the device
intercept -g $DEVNODE | y2z | x2y | uinput -d $DEVNODE

Other ones:

Another one, in C, with QMK class of configs in a simple config file(s)
https://github.com/rvaiya/keyd

Flexible syntax and effect system, supports partial layers / default layer mods..
Has an IPC mechanism to support per application (X11/Wayland) mappings in user-land.
Has nice lowlevel keys debugging/monitoring tools

~nice example: https://github.com/rvaiya/keyd/blob/master/examples/capslock-escape-with-vim-mode.conf

Keyd docs: https://github.com/rvaiya/keyd/blob/master/docs/keyd.scdoc
Keyd app mapper docs: https://github.com/rvaiya/keyd/blob/master/docs/keyd-application-mapper.scdoc

Inspired from Reactive Programming, I'd love to have (or make 👀) a key remapper that works on streams of events...
A 'plugin' could 'subscribe' to a stream, and the core could provide helpers to make +/- advanced streams that combine/understand/interpret the actual events (taps, double taps, combinations, ...).

Refs:

https://github.com/k0kubun/xremap
(written in Rust!)

xremap is a key remapper for Linux. Unlike xmodmap, it supports app-specific remapping and Wayland.

Features:

  • Remap any keys, e.g. Ctrl or CapsLock.
  • Remap any key combination to another, even to a key sequence.
  • Remap a key sequence as well. You could do something like Emacs's C-x C-c.
  • Remap a key to two different keys depending on whether it's pressed alone or held.
  • Application-specific remapping. Even if it's not supported by your application, xremap can.
  • Automatically remap newly connected devices by starting xremap with --watch.
  • Support Emacs-like key remapping, including the mark mode.

Looking at the available functions, it seems to support double role keys, with timeout (!!)
-> See option alone_timeout_millis

Not system wide, but at X11 level:

https://github.com/phenax/shotkey

A Simple Hot Key daemon for X inspired by the suckless philosophy with configurable custom modes.

~200 LOC. ~20KB binary.

Configured by editing the config.h file.

If I want to make my own hydra (see: https://github.com/anuvyklack/hydra.nvim) for the desktop, it could be useful to rewrite this simple hotkey daemon first?