- Zig 99.9%
- C 0.1%
| src | move globbing to tributary | |
| .gitignore | correctly merge list config | |
| build.zig | update to libtributary-0.4.0 | |
| build.zig.zon | tag a small release with some fixes | |
| config.rh | implement binding devices to outputs by name and description | |
| CONTRIBUTORS.md | add CONTRIBUTORS.md | |
| LICENSE | add license, resolve #1 | |
| README.asciidoc | fix type (thx Vess) | |
| TODO.md | overhaul a bunch of things | |
in order to tame a river, one must channel it
Channel: input config for river
channel sources a file called config.rh from your river config directory and example is found in this repo.
This config file is shared with the rhine window manager. The relevant config options are entirely independent and the two programs do not interfere.
The config is reapplied, whenever a new device is added or the file changes.
Configuration options
Channel uses the rhine config format. This means your config consists of a bunch of keys, sub-configs and lists.
There is an example config in config.rh but here are the most important details:
The config is reloaded whenever it is changed for as long as channel keeps running.
All channel options live in one big block called input, so your config will look something like
input {
profiles {
# you could have profiles here
}
rules [
# you could have rules here
]
}
The idea is the following: we define our input configuration in a collection of profiles and then provide a list of rules to figure out which devices a profile gets applied to.
Profiles
The profiles block contains a number of profile definitions which are of the form
<name> {
keyboard {
# keyboard options go here
}
pointer {
# pointer config goes here
}
libinput {
# libinput config goes here
}
}
You may omit any of these blocks and it will be treated as if the block were empty.
The profile name <name> can be any whitespace-less ASCII string except for any, type or name.
Keyboard
The keyboard block contains configuration options pertaining to keyboards. It contains the following options:
| Option | Description |
|---|---|
|
the rules bit of link:https://xkbcommon.org/doc/current/xkb-intro.html#RMLVO-intro |
|
the model bit of link:https://xkbcommon.org/doc/current/xkb-intro.html#RMLVO-intro |
|
the layout bit of link:https://xkbcommon.org/doc/current/xkb-intro.html#RMLVO-intro |
|
the variant bit of link:https://xkbcommon.org/doc/current/xkb-intro.html#RMLVO-intro |
|
the options bit of link:https://xkbcommon.org/doc/current/xkb-intro.html#RMLVO-intro |
|
key repetition options |
Repeat
The aforementioned repeat block consists of the following options:
| Option | Description |
|---|---|
|
The rate in Hz at which a held-down key gets repeated |
|
the delay in milisecond after which a held-down key starts getting repeated |
Pointer
The pointer block specifies options pertaining to mice and similar devices.
| Option | Description |
|---|---|
|
The factor at which scroll speed gets increased or decreased. A factor of 3 would triple scroll speed, 0.5 would half it. |
|
maps a mouse, touchpad, drawing tablet, touchscreen to the specified subsection of the screen. see Mapping |
Mapping
The parameter to map_to can be of the following form:
| Option | Description |
|---|---|
|
restricts the input device to a rectangle whose top left corner is at |
|
restricts the input device to the first output found whose name matches the given wildcard. |
|
restricts the input device to the first output found whose description matches the given wildcard. |
Libinput
This blocks specifies options that are specific to libinput (a massive input device configuration library). An option will only be applied to a device that supports it and if omitted be set to the default value for that device. If you want more details on what these options do, check out link:https://wayland.freedesktop.org/libinput/doc/latest/features.html
Here <Button> refers to a mouse button, which is one of
-
Left -
Right -
Middle -
Side -
Extra -
Forward -
Back -
Task
| Option | Description |
|---|---|
|
if |
|
if |
|
if |
|
if |
|
if |
|
if |
|
set the rotation anlge of the device to |
|
sets three finger drag mode to |
|
sets acceleration profile to |
|
sets acceleration speed to |
|
sets the scroll method to |
|
the button to use when the scroll method is |
|
sets click method to |
Rules
The rules list is where we actually apply out profiles to an input device.
Each line in this section is a rule. Rules are of the following form
<matches>, <profile>
here <profile> is to be substituted with the name of the profile you’d like to apply.
<matches> is a , separated list of matching rules, matching rules can be any of the following:
| Rule | Description |
|---|---|
|
this always matches and is the same as not having that match in the list. it is provided purely for aesthetic reasons. |
|
This matches |
|
This matches |
If a device matches all rules in <matches>. The profile <profile> is applied to it.
If a device matches multiple profiles specifying conflicting options either may get applied.
Globbing
Channel supports primitive string globbing. A glob is simply a string which may contain one or more *.
A string matches a glob, if all occurences of * in the glob could be replaced by one or more characters
in order to obtain the string.
Examples
-
the glob
Touchpadonly matches the stringTouchpad -
the glob
*ouchpadmatchestouchpad,Touchpad,my Touchpadbut notouchpad -
the glob
**matchesHi,Hellobut nota
Dependencies
Protocols bound
channel binds the following wayland protocols:
-
river-input-management-v1
-
river-libinput-config-v1
-
river-xkb-config-v1
Shared libraries
channel links the following shared libraries:
-
libwayland-client
-
libc
-
libxkbcommon (0.12 or later)
Static Dependencies
channel uses the zig build system to statically depend on tributary a small helper library that facilitates code sharing between rhine and channel.