Table of Contents

Name

kbbind - Remap keys and run commands

Synopsis

kbbind [-sdvr] [-p file] [-u path] [-n name] -e|<config file> <input device>

Description

Utility for mapping keys/combinations to other keys/combinations/commands. Events are read from a single keyboard via an event device and any mapped keys are passed back to the kernel through a virtual input (uinput) device.

Options

-s
Sink mode - Trap all events and only forward mapped ones
-d
Detach from console and run as a daemon, send messages to syslog
-v
Print version number and exit
-p file
Write PID to file and delete on exit
-u path
Override default uinput device path (/dev/input/uinput)
-n name
Override default uinput device name (kbbind virtual keyboard)
-e
Read events from device and print key events to stdout.
-r
Don’t send an EV_SYN/SYN_REPORT event after every other uinput event.

Configuration

The configuration file allows one directive per line with arguments seperated by spaces/tabs, lines starting with a hash (#) character are ignored. Single keys or combinations using the x+y+z syntax may be used with all directives. The following directives may be used:
map <key a> <key b>
Map key a to b. For example ’map 75 125+103’ maps key 75 to combination 125+103.
drop <key>
Drop events recieved for the given key. If a combination is supplied, the individual keys will not be ignored, only the inputs from the last key in the combination while the rest are held down. Using this while sink mode (-s) is in use is redundant as all unmapped keys will be ignored by default.
exec <key> <command>
Execute a shell command when the given key is pressed or autorepeats. The terminal will be redirected to /dev/null when kbbind is running as a daemon.
alias <name> <key>
Set an alias to the specified key, any existing alias will be replaced. The alias may refer to a combination and may be used anywhere, for example, the following map statements are effectively the same:

alias win 125
alias win_up win+103

map 75 125+103
map 75 win+103
map 75 win_up

Environment

SHELL
Set the shell used to execute commands, /bin/sh will be used if this is not set.


Table of Contents