-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a major release which breaks backward compatibility for non-trivial configs. (we are still in beta after all :P). In the absence of too much blowback this will probably become the final v2 design. Much of this harkens back to the v1, with some additional simplifications and enhancements. See DESIGN.md for a more detailed account.
- Loading branch information
Showing
67 changed files
with
3,131 additions
and
3,038 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
This document contains a description of major design changes. | ||
It is not intended to be exhaustive. | ||
|
||
# v2.3.0-rc | ||
|
||
This is a major release which breaks backward compatibility for | ||
non-trivial configs. (we are still in beta after all :P). | ||
|
||
In the absence of too much blowback, this will probably become the final | ||
v2 design. | ||
|
||
Much of this harkens back to the v1, with some additional simplifications | ||
and enhancements. | ||
|
||
## Notable changes: | ||
|
||
- Introduced composite layers | ||
|
||
- Replaced three arg overload() with a more flexible timeout() mechanism | ||
|
||
- Eliminated sequences in favour of macros (C-x is now just syntactic | ||
sugar for macro(C-x)). | ||
|
||
- Actions which previously accepted sequences as a second argument | ||
now accept macros of any kind. | ||
|
||
- General stability/speed/memory improvements | ||
|
||
- Made the man page less war and peacey | ||
|
||
## Non backward-compatible changes: | ||
|
||
- Modifiers now apply to all bindings with the exception of modifiers | ||
associated with the layer in which the key is bound. | ||
|
||
Rationale: | ||
|
||
The end result is more intuitive and allows for modifiers to be paired with | ||
layer entries. | ||
|
||
E.G | ||
capslock = layer(nav) | ||
|
||
[nav:C] | ||
|
||
h = left | ||
l = right | ||
|
||
will cause 'control+h' to produce 'left' (rather than 'C-left'), while | ||
'control+capslock+h' will produce 'C-left', as one might intuit. | ||
|
||
- Abolished layer types. Notably, the concept of a 'layout' no longer exists. | ||
Bindings are drawn from layers on the basis of activation order with [main] | ||
being active by default. | ||
|
||
Rationale: | ||
|
||
This simplifies the lookup logic, elminates the need for dedicated layout | ||
actions, and makes it easier to define common bindings for letter layouts | ||
since the main layer can be used as a fallback during lookup. | ||
|
||
E.G | ||
|
||
[main] | ||
|
||
capslock = layer(capslock) | ||
|
||
[dvorak] | ||
|
||
a = a | ||
s = o | ||
... | ||
|
||
[capslock] | ||
|
||
1 = toggle(dvorak) | ||
|
||
- Special characters within macros like ) and \ must be escaped with a backslash. | ||
|
||
- Modifier sequences (e.g 'C-M') are no longer valid layers by default. | ||
|
||
Rationale: | ||
|
||
This was legacy magic from v1 which added a bunch of cruft to the code and | ||
seemed to cause confusion by blurring the boundaries between layers and | ||
modifiers. Similar results can be achieved by explicitly defining an | ||
empty layer with the desired modifier tags: | ||
|
||
I.E | ||
|
||
a = layer(M-C) | ||
b = layer(M) | ||
|
||
becomes | ||
|
||
a = layer(meta-control) | ||
b = layer(meta) | ||
|
||
[meta-control:M-C] | ||
|
||
Note that in the above sample "meta" does not need to be | ||
explicitly defined, since full modifier names are | ||
|
||
- Eliminated -d | ||
|
||
Rationale: | ||
|
||
Modern init systems are quite adept at daemonization, and the end user | ||
can always redirect/fork using a wrapper script if desired. | ||
|
||
- Eliminated reload on SIGUSR1 | ||
|
||
Rationale: | ||
|
||
Startup time has been reduced making the cost of a full | ||
restart negligible (and probably more reliable). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
- Organize tests. | ||
- Improve FAQ. | ||
- Add more examples. | ||
- Multi user support? | ||
- Unicode support? | ||
fix hotswap | ||
cleanup manpage | ||
add [globals] with configurable macro timeouts. | ||
[idea] tmux like layer timeouts | ||
nested timeouts? (perhaps not...) | ||
toggleable composite layers? | ||
improved mouse support (integrate moused?) | ||
organize tests | ||
unicode support | ||
multi-user support (remove keyd group) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
keyd-application-mapper(1) | ||
|
||
# USAGE | ||
|
||
keyd-application-mapper [-d] | ||
|
||
# OVERVIEW | ||
|
||
A script which reads _~/.config/keyd/app.conf_ and applies the supplied | ||
bindings whenever a window with a matching class comes into focus. | ||
|
||
You can think of each section as a set of application specific masks applied | ||
over the global rules defined in _/etc/keyd/\*.conf_. | ||
|
||
The config file has the following form: | ||
|
||
``` | ||
[<filter>] | ||
<expression 1> | ||
<expression 2> | ||
... | ||
``` | ||
|
||
Where _<filter>_ has one of the following forms: | ||
|
||
\[<class exp>\] # Match by window class | ||
\[<class exp>|<title exp>\] # Match by class and title | ||
|
||
and each _<expression>_ is a valid argument to _-e_ (see *Expressions*). | ||
|
||
_<class exp>_ and _<title exp>_ are strings which describe window class and title names | ||
to be matched, and may optionally contain unix style wildcards (\*). For example, | ||
_[gnome|\*find\*]_ will match any window with a class of _gnome_ and a title | ||
containing the substring _find_. | ||
|
||
E.G: | ||
|
||
``` | ||
[kitty] | ||
alt.] = C-tab | ||
alt.[ = C-S-tab | ||
alt.t = C-S-t | ||
[st-*] | ||
alt.1 = macro(Inside space st) | ||
[chromium] | ||
control.1 = macro(Inside space chrome!) | ||
alt.] = C-tab | ||
alt.[ = C-S-tab | ||
alt.t = C-t | ||
``` | ||
|
||
Will remap _A-1_ to the the string 'Inside st' when a window with a class | ||
that begins with 'st-' (e.g st-256color) is active. | ||
|
||
Window class and title names can be obtained by inspecting the log output while the | ||
daemon is running (e.g _tail\ -f\ ~/.config/keyd/app.log_). | ||
|
||
At the moment X, Sway and Gnome are supported. | ||
|
||
# INSTALLATION | ||
|
||
Installation is a simple matter of running the command _keyd-application-mapper -d_ | ||
somewhere in your display server initialization logic (e.g _~/.xinitrc_ or | ||
_~/.xsession_). If you are running Gnome, | ||
running _keyd-application-mapper_ for the first time will install an extension | ||
which manages the script lifecycle. | ||
|
||
In order for this to work, keyd must be running and the user must have access | ||
to */var/run/keyd.socket* (i.e be a member of the *keyd* group). | ||
|
||
# A note on security | ||
|
||
Any user which can interact with a program that directly controls input devices | ||
should be assumed to have full access to the system. | ||
|
||
While keyd offers slightly better isolation compared to other remappers by dint | ||
of mediating access through an IPC mechanism (rather than granting users | ||
blanket access to /dev/input/\* and /dev/uinput), it still provides an | ||
opportunity for abuse and should be treated with due deference. | ||
|
||
Specifically, access to */var/run/keyd.socket* should only be granted to | ||
trusted users and the group _keyd_ should be regarded with the same reverence | ||
as _wheel_. | ||
|
Oops, something went wrong.