kiss

When I used to use an extremely minimal X environment, I needed a way to launch applications without taking up extra screen space. I came up with the idea of monitoring mouse events on the root window, and developed kiss as a result. The concept is simple - hit the mouse pointer against the edge of the screen two or more times in quick succession, and this triggers some behaviour that you define in a user-supplied client program.

Download

kiss-1.1.tgz version 1.1 [BSD license]

kisslib-1.1.tgz version 1.1 [public domain]

Installation

Unpack the kiss archive, enter the directory and review the settings in the Makefile to make sure that they match your system. Then make and make install, the latter with root access if installing system-wide (via su or sudo for example.)

You may need to install some packages to have a working development environment to build X applications. On a Debian-based system, this will be something like build-essentials and libx11-dev.

The default client is pretty simple, but should be generic enough to be a useful base for customisation. The optional kisslib has my original client setup in it, which references a load of old scripts, but could be useful for further ideas.

Usage

In your X startup (e.g. in .xsession) run kiss:

/usr/local/bin/kiss -client /usr/local/etc/kisslib/kiss-client

kiss keeps running until the client exits normally, or if the client exits abnormally too many times. You can use it as the main session if you're confident that it won't exit straight away; when I had a minimal setup I spawned everything as background tasks and held onto the session with a dummy program.

The full list of options:

OptionPurpose
-display displaySet the display to connect to
-screen screenSet the screen to connect to
-fifos directorySpecify the directory in which to create fifos (internal communication channels)
-delay msSpecify the maximum delay between edge hits to allow them to chain together into a kiss event
-client clientSpecify the client to execute to handle kiss events

Caveats

This is pretty old code, but it ought to still work.

You ought to have some understanding of older-style X startup configuration to use this.

It relies on being able to monitor the root window, which doesn't work well with modern desktop environments and fancy window-managers. Sorry.

Client

The client is responsible for interpreting the sequence of mouse movements. Whenever the mouse pointer touches the side of the screen, it is stored as a kiss event. A sequence of such kisses all occuring within a specific time-limit of the previous kiss will be stored up in a sequence, and sent to the client once no more kisses are being added. The client receives all of the kisses simultaneously.

Kiss sequences are sent to the client on its standard input, and consist of a space-separated sequence of parameters. The first parameter is the length of the kiss sequence, then the rest of the input sequence is a block of 6 parameters for each kiss:

  1. Side ([BTLR])
  2. X-coordinate
  3. Y-coordinate
  4. Key modifier (-|[CLS12345]+)
  5. Mouse buttons (-|[12345]+)
  6. Time delay (milliseconds)

The time delay of the first kiss is zero, all others are relative to the previous kiss event. Note that the window manager may make it difficult to receive certain combinations of key modifiers and mouse buttons.

The client is expected to launch applications in the background and return to wait for the next kiss sequence. It should only exit if the user requests it to do so with a particular kiss sequence. To provide a way of restarting the client gracefully, terminating the client with a SIGUSR1 will not count towards the number of abnormal terminations, but will still cause kiss to respawn the client.