KeysID |
linux keys intercepting daemon |
|
Documentation keysid - keys intercepting daemon - Introduction - Installation - Configuration - Usage - Contact me ------------ Introduction ------------ keysid is a highly configurable linux daemon which lets you intercept keyboard key strokes and make them execute the programs you want. It's thought for laptop and multimedia keyboards, which usually have more keys than standard keyboards, but it works with all the keys. ----------- Installation ----------- In order to compile and install from the source package you can simply type: ./configure --prefix=/usr make make install with the --prefix you want. <debian> It will put programs in /usr/sbin and the init script in /etc/init.d/ . </debian> If you are new to keysid PLEASE READ THE NEXT SECTION BEFORE RUNNING THE PROGRAM. ------------- Configuration ------------- Now that `keysid' is installed you must run it's configuration program (keyscfg) before running the daemon. This is the usage: keyscfg <-n keynumber> [-f config_file] [-d device] `-n' is required, it stands for the number of keys you want to intercept `-f' is the path to the output configuration file, default is `/etc/keysid/keysid.conf' `-d' is the device you want to read from. The default is `/dev/input/event0', you shouldn't use this option unless you know what you are doing. Run `keyscfg', _don't press any key_ until it's beginning message, then you will asked for pressing as much keys as you requested (`-n' option). If these steps go right you'll find the configuration file in /etc/keysid/keysid.conf (unless you gave the `-f' option). Well, now you have to edit the configuration file. The first line is the device the program reads from, you shouldn't edit this line since the configuration file depends on the input device. The second line is the program executed on timeout. The first field is the number of seconds the daemon waits to before it executes the command, if you set it to 0 the program won't be executed. e.g.: 300 crowolo openvt -s -w -- vlock -a Read below for the syntax of the `user' and `command' fields. The other lines (no `#' comments, no white lines) are in the form: key user command The key field shouldn't be edited. The user field stands for the user who executes the command (the next field). The command is read to the end of the line, it may contains spaces. The command will be executed as `su - user -c "command" ', therefore.. be careful about escaping! e.g.: 0xcc crowolo mpg123 ~/songs/*.mp3 0xcc -> the key crowolo -> the user mpg123 ~/songs/*.mp3 -> the command This line will be executed as `su - crowolo -c "mpg123 ~/songs/*.mp3" '. ----- Usage ----- Now you can start the daemon (keysid). You can also specify the configuration file the daemon will read by passing it as command-line argument. e.g.: keysid /root/tmpkeysid.conf <debian> The debian package provides the init script which can be used to run the daemon at boot time. If you want to run it by init script and make the daemon read from a non-default file, you must edit /etc/default/keysid . </debian> ---------- Known bugs ---------- You shouldn't press any key for a couple of milliseconds after you start both the daemon and the configurator program, otherwise the program couldn't get your input in the right way. ---------- Contact me ---------- For questions, bug reports and so on please send a mail to <scrows at oziosi.org> . Have fun! Daniele |