keynav is configured by default from a config file in your home directory "~/.keynavrc"
The default configuration can be found in the "DEFAULT CONFIGURATION" section.
'#' will delimit comments. The configuration consists mostly of binding keys to keynav commands. The
following to commands must appear on lines by themselves, not as key bindings.
daemonize
This will make keynav background itself after parsing the config file and setting up keybindings. If
there are errors during keybinding, then keynav will not background and will exit with failure.
clear
This wil clear all existing keybindings. This is useful if, for example, you do not want any of the
default keybindings that come with keynav.
The rest of the configuration has this format
keybinding keynav-command[,keynav-command,...]
You can have multiple commands for a single keybinding.
The way to start keynav's navigation is to use the 'start' command. Additionally, any keys with 'start'
as a command will be grabbed as global hotkeys. For example, this configuration:
ctrl+semicolon start
space click 1
This will make keynav grab the ctrl+semicolon keybinding globally, but it will not grab space. The
space keybinding will only be active while keynav is active (after you press a key sequence that invokes
start.
In case of a keyboard layout where semicolon is just reachable by pressing Shift, the activation key
combination actually might not be ctrl+shift+[othercharacter], but just ctrl+[othercharacter], e.g.
ctrl+comma instead of ctrl+shift+comma on Swiss-German or German-German layouts.
If you aren't sure what the name of your key is, you can run xev(1) and press each key you want to learn
about while the xev window has focus. The output will include the keysym name (like Shift_L, or Return,
etc)
Moving on, here are all the keynav commands you can use:
CUTSANDMOVES
Movements are bounded by screen edges. See "SCREEN EDGES" for edge and multiple screen handling.
cut-up[value]
This will cut the keynav window upwards. We will shrink from the bottom upwards. The default cut
value, if not specified, is 0.5
See "CUT AND MOVE VALUES" for what this value means.
cut-down[value]
This will cut the keynav window downwards. We will shrink from the top down. The default cut value,
if not specified, is 0.5
See "CUT AND MOVE VALUES" for what this value means.
cut-left[value]
This will cut the keynav window leftwards. We will shrink from the right to the left. The default cut
value, if not specified, is 0.5
See "CUT AND MOVE VALUES" for what this value means.
cut-right[value]
This will cut the keynav window rightwards. We will shrink from the left to the right. The default
cut value, if not specified, is 0.5
See "CUT AND MOVE VALUES" for what this value means.
move-up[value]
This will move the window up. The default value, if not specified, is 1.
See "CUT AND MOVE VALUES" for what this value means.
move-down[value]
This will move the window down. The default value, if not specified, is 1.
See "CUT AND MOVE VALUES" for what this value means.
move-left[value]
This will move the window left. The default value, if not specified, is 1.
See "CUT AND MOVE VALUES" for what this value means.
move-right[value]
This will move the window right. The default value, if not specified, is 1.
See "CUT AND MOVE VALUES" for what this value means.
cursorzoomwidthheight
This command centers the keynav window on the mouse position and sets the window size to the given
width and height (in pixels).
windowzoom
This command makes the keynav window fit the current application window. This is useful if you have
your windows in a tiled arrangement.
GRIDCOMMANDSgrid[COLUMNSxROWS]
The default 'grid' is 2x2. If you want more grid cells you can choose any number of columns and rows.
grid-nav[onORoffORtoggle]
Grid navigation is off by default. When turned on, every grid cell will have a two-letter label. To
select a single cell, you simply type the two letters. The 'toggle' value will toggle grid-nav.
cell-select[value]
Cell selection is similar to grid-nav, but less visual. You would bind keys to select specific cells.
With cell-select, there are no labels.
The value can be one of two formats. First, the COLUMNxROW syntax. 'cell-select 3x1' will select
column 3, row 1. The second format is simply a number. The number represents the counting of the
cell, starting at the top left and working right.
A visual might help. With 'grid 3x3' the following is used with cell-select:
+----------------------------------------------+
| | | |
| 1x1 | 2x1 | 3x1 |
| 1 | 2 | 3 |
| | | |
|--------------+---------------+---------------|
| | | |
| 1x2 | 2x2 | 3x2 |
| 4 | 5 | 6 |
| | | |
|--------------+---------------+---------------|
| | | |
| 1x3 | 2x3 | 3x3 |
| 7 | 8 | 9 |
| | | |
|----------------------------------------------|
MOUSECOMMANDSwarp
This command moves the mouse pointer to the center of the keynav window.
click[button]
This command will send a mouse click. It does not move the mouse, so the click will go wherever the
mouse is positioned. The button values are this: 1 = left, 2 = middle, 3 = right, 4 = wheel up, 5 =
wheel down.
doubleclick[button]
Double clicks, but otherwise is the same as click.
dragbutton[modifier-keys]
Starts or ends dragging, depending on state (dragging or not). The button values are the same as for
click. The modifier-keys value allows you to specify any keys to 'hold' while dragging, such as alt
or shift.
Dragging sometimes doesn't work. I'm trying to make it more reliable. File a bug if you are
interested in this feature working :)
MISCCOMMANDSrecord[file]
Record actions for replay later. Very similar to vim's 'q' command. The first key you press after
starting a new recording becomes the active key for that recording. You cannot record to keys that
are already bound to other commands, but you can overwrite existing recordings. If you want to
persist recordings across keynav processes (like system or keynav restarts, etc) you will want to
specify a file, I use "~/.keynav_macros" but any path will do.
For example, this config: 'q record'. Pressing 'q' then 'l' will start recording to the 'l' key
assuming it's not already bound. Then, to stop recording, press 'q' again (the record key as
configured). After that, to replay that recording, simply press playback and then 'l' while the
keynav window is active.
playback
Replay a previously recorded sequence of keys. After invoking the command, keynav will wait for the
key of a previously recorded session.
shcommand
Run a command with /bin/sh -c <command>. This is slightly outside the scope of keynav, but executing
arbitrary commands is very useful when combined with xdotool. For example, I use this to activate
Google Chrome and focus the URL bar:
g sh "xdotool search --name -- '- Google Chrome' windowactivate key --window 0 --clearmodifiers ctrl+l",end
loadconfigpath
Load an additional config file. Paths like '~/foo/bar' are valid and the '~' will be replaced with
your home directory (Value of $HOME in environment).
start
Start keynav. Any keys with this binding will operate as global bindings to activate keynav.
end End keynav. This hides the keynav window and otherwise makes keynav inactive until the next 'start'
command.
history-back
Go backwards in command history. All activity is tracked in history, so if you want to undo a
movement, etc, simply use this command.
quit
Exit keynav. The process will shutdown.
restart
Restart keynav. Useful for reloading the configuration. SIGHUP and SIGUSR1 also invoke this command.