Next Previous Contents

3. Usage

3.1 General Usage

FXred is very simple to use. Usually it is started without any options.

Then FXred reads the configuration file. If this is successful, it puts itself in the background and exits. These options are understood by FXred:

-k

Kill the running instance. Since FXred is a daemon, starting another FXred is pretty useless. It therefore remembers that it is running by writing a lock file at /var/lock/fxred. If you want to replace this instance, e.g. because you changed the configuation file, use the -k switch.

-l

Don't use the lock file. This is useful if you have to start two fxreds on the same machine (e.g. with two X servers).

-f

Don't change focus. The focused window is the one that receives keyboard input. Some window managers automatically focus the window under the mouse, others require a click. For the latter, fxred virtually clicks for you when scrolling and then focuses the formerly focused window. If this doesn't work, use -f.

-d

Don't become a daemon. FXred remains in the foreground and can be killed by Control-C.

-b

Allows to specify a different button (1-5) instead of the red one. This option allows the use of other mice/trackballs with fxred.

-t

Allows to specify a minimum ball movements before emmitting a key. Smaller numbers scroll faster. Larger numbers provide more control.

-h

Display the help.

-q

Quit before grabbing the red key. This is only useful with -k.

-w

Forward the scroll button click to the application. This is useful for three-button mice, so you don't waste a button just for scrolling.

The configuration file is searched for in the current directory and in the parent directory as fxredrc, in the users home directory as .fxredrc and as prefix/etc/fxredrc (prefix is the installation prefix as given to configure) in that order. The first file to be found is read, all other are ignored.

3.2 Configuration file syntax

The configuration file is read line by line. No line should be longer than 255 characters. Empty lines are ignored. Lines starting with a hash (aka number sign, aka #) are comments. All other lines are either application patterns or direction key maps.

An application pattern is a POSIX extended regular expression enclosed in double quotes. See the regex manual page for details of POSIX regular expressions. The application pattern is checked against the window title, resource class and resource name. If it matches one of them and a direction key map of the moved direction exists, it is executed. The configuration file has to contain at least one application pattern before a direction keymap. Application pattern are checked in the same order as they appear in the configuration file.

Direction key maps are lines starting with a lower case direction (l,r,u,d,>,< for Left, Right, Up, Down, Push and Release). A single space follows. The rest of the line is the key map.

A key map is a comma separated list of modified keys. The direction key maps are sent when the ball is rolled in the respective direction. The Push key map is sent when the red button is pushed, the Release key map when it is released.

A modified key is a list of simultaneously pushed keys. It is recommended that the start of the list is made of modifiers like Control,Shift,etc and the the last item of the list is an actual key.

The individual key names are those that X11 uses.

The following snippet illustrates the above.

# KDE2's advanced editor scrolls up and down when holding control.
"Advanced Editor"
u Control_L|Up
d Control_L|Down

# The defaults. Should remain at the end.
".*"
l Left
r Right
u Up
d Down


Next Previous Contents