1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
.TH jslaunch 1
.SH NAME
jslaunch - executes shell commands on joystick button presses
.SH SYNOPSIS
jslaunch [-r buttons "command"] [-p time] [-w time] [-i buttons]
[-l lockfile] [-d]
.SH DESCRIPTION
.B jslaunch
is a utility/daemon that will execute a shell command when
a specified combination of joystick buttons is pressed. Up to
15 joystick button combinations are possible, provided you
have 4 buttons.
One way to use it is as a backup way to shut down the computer
if the terminal has been messed up, or shutting down the
X server if it has crashed. It also makes the joystick buttons
useful as a remote control device.
.PP
As the joystick interface doesn't supply interrupts, this program
polls. The default polling interval is 500 milliseconds (half a second),
but you can change this. The CPU impact of this polling action is
minimal because the kernel joystick driver is not used
(about 8 assembly instructions, every 500 milliseconds, will
not produce more than 0.01 seconds of CPU time every 2 months, even
with context switching, on a P100). The memory footprint of this program
is also kept to the bare minimum (about 40 kB).
.PP
For an easy way of starting
.B jslaunch
as a daemon, look at
.B jslaunchd(1)
To test which joystick button has which number and supply the -r option
with button specification, look at
.B jslaunch_showbuttons(1)
.PP
.B jslaunch
is setuid safe; special permissions are given up before
the lock file is made and any shell command is executed. One reason
you might not want to have jslaunch suid, is if you don't want other
users to find out which joystick buttons you are pressing.
.SH OPTIONS
.TP 5
.B -r [1][2][3][4] "command"
Run
.B "command"
at button combination
.B [1][2][3][4]
The joystick
button specification is a combination of digits without spaces
in between, specifying the joystick buttons to be pressed; example:
.B jslaunch -r 12 'ppp on'
will run the command
.B 'ppp on'
when both buttons 1 and 2 are pressed. Note that it is advisory
to have the command quoted.
.TP 5
.B -p time
Set the polling time to
.B time
milliseconds (1/1000 of a second, aka. ms)
.TP 5
.B -w time
Set the time between the detection of a joystick button press and
the actual readout of which buttons are pressed to
.B time
milliseconds.
This will allow the user some time to press all the required buttons
simultaneously.
.TP 5
.B -i [1][2][3][4]
Ignore input from the joystick buttons
.B [1][2][3][4]
Buttons are specified the
same way as with
.B -r.
.TP 5
.B -d
Run as a daemon; this will also close stdin, stdout and stderr.
.TP 5
.B -l lockfile
Create a file and lock it, so that if you try to run another jslaunch
with the same
.B -l lockfile
option, it will refuse to start.
.SH EXAMPLE
jslaunch -r 12 "/sbin/shutdown -r now" -r 34 "killall X" -p 250 -w 200
-d -l /var/lock/subsys/jslaunch.
.PP
Will reboot the system if both buttons 1 and 2 are pressed, and
kill any X server if buttons 3 and 4 are pressed. The polling
interval is 250 milliseconds, the wait time is 200 ms.
It will start as a daemon, and will lock the file
.B/var/lock/subsys/jslaunch
.SH SEE ALSO
jslaunch_showbuttons(1), jslaunchd(1), isapnp(8)
.SH VERSION
2.0, august 1998
.SH BUGS
Please contact me if you find any
.P
If jslaunch doesn't seem to react to button presses and you
have the joystick interface on a Plug & Play card, you
might have to enable it using isapnp. See the README file for
more info.
.SH AUTHOR
Sander Pronk <pronk@amolf.nl>, with suggestions from
Johan Walles.
|