dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Linux keyboard daemon

Open bew opened this issue 5 years ago • 5 comments

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

bew avatar May 29 '20 08:05 bew

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

bew avatar Oct 19 '20 00:10 bew

Other ones:

  • KMonad: https://github.com/kmonad/kmonad, cross-platform (❤️), configured in a Lisp language Tutorial is very complete, but seems to require a full definition of the keymap (like qmk)..
  • Hawck: https://github.com/snyball/Hawck, configured in a Lua DSL (with a nice separation between the system daemon & a user daemon with access to X stuff)

bew avatar Jun 30 '21 14:06 bew

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

bew avatar Dec 11 '21 16:12 bew

Inspired from Reactive Programming, I'd love to have (or make :eyes:) 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://gist.github.com/bew/525c0ecd6b8bd27120f98d173c6dd170 (backup of excellent intro to this reactive programming!)
  • https://www.reactivemanifesto.org/
  • https://en.wikipedia.org/wiki/Observer_pattern

bew avatar Dec 27 '21 04:12 bew

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

bew avatar Apr 08 '22 08:04 bew

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?

bew avatar Jul 07 '22 12:07 bew