Skip to content

Commit 782abf4

Browse files
committed
Doc: Manual and usage overhaul
- cmatrix.1 > cmatrix.6 (screensavers traditionally filed as games) - rewrite in mdoc(7) - write document description for visibility in manual searches - maintain synopsis, options, and keystrokes - write vendor neutral description of the program - add examples including vendor neutral examples - move homepage to SEE ALSO, link it, and relevant pages - add terse HISTORY - make program usage output consistent with the maintenance above Fixes: #87, #105, and #162
1 parent 5c082c6 commit 782abf4

File tree

5 files changed

+160
-121
lines changed

5 files changed

+160
-121
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ add_executable(cmatrix cmatrix.c)
6969
target_link_libraries(cmatrix ${CURSES_LIBRARIES})
7070

7171
install(TARGETS cmatrix DESTINATION ${CMAKE_INSTALL_BINDIR})
72-
install(FILES cmatrix.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
72+
install(FILES cmatrix.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
7373

7474
if (UNIX)
7575
foreach (CONSOLE_FONTS_DIR ${CONSOLE_FONTS_DIRS})

Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
bin_PROGRAMS = cmatrix
22
cmatrix_SOURCES = cmatrix.c
33

4-
man_MANS = cmatrix.1
4+
man_MANS = cmatrix.6
55

66
if MATRIX_FONTS
77
BUILD_FONTS = 1
@@ -11,7 +11,7 @@ endif
1111

1212
EXTRA_DIST = COPYING INSTALL install-sh \
1313
missing mkinstalldirs matrix.fnt \
14-
matrix.psf.gz mtx.pcf cmatrix.1 cmatrix.spec
14+
matrix.psf.gz mtx.pcf cmatrix.6 cmatrix.spec
1515

1616
install-data-local:
1717
@if test $(BUILD_FONTS) = 1; then \

cmatrix.1

Lines changed: 0 additions & 101 deletions
This file was deleted.

cmatrix.6

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
.Dd April 5, 2024
2+
.Dt CMATRIX 6
3+
.Os
4+
.Sh NAME
5+
.Nm cmatrix
6+
.Nd Matrix digital rain terminal screensaver
7+
.Sh SYNOPSIS
8+
.Nm
9+
.Op Fl \&?abBcfhklLmnorsVx
10+
.Op Fl C Ar color
11+
.Op Fl M Ar message
12+
.Op Fl t Ar tty
13+
.Op Fl u Ar delay
14+
.Sh DESCRIPTION
15+
The
16+
.Nm
17+
utility shows random 8-color characters raining down a terminal, at a
18+
user-defined speed, either at the same rate or asyncronously.
19+
.Pp
20+
The following command-line options are available:
21+
.Pp
22+
.Bl -tag -width "-M message" -compact
23+
.It Fl a
24+
Asynchronous scroll
25+
.It Fl b
26+
Bold characters on
27+
.It Fl B
28+
All bold characters, overrides
29+
.Fl b
30+
.It Fl c
31+
Use Japanese characters, requires appropriate font
32+
.It Fl C Ar color
33+
.Sq Ar green
34+
Use one of the eight
35+
.Ar color Ns s in the table below
36+
.It Fl f
37+
Force the
38+
.Va $TERM
39+
type to be on
40+
.It Fl h , Fl \&?
41+
Print usage and exit
42+
.It Fl k
43+
Change characters while scrolling, cannot combine with
44+
.Fl o
45+
.It Fl l
46+
Linux mode, use matrix console font
47+
.It Fl L
48+
Lock mode, can be
49+
.Xr kill 1 Ns ed
50+
from another terminal
51+
.It Fl m
52+
Lambda mode, every character becomes a lambda
53+
.It Fl M Ar message
54+
Add centered
55+
.Ar message
56+
overriding
57+
.Fl L Ns Ap s
58+
default
59+
.It Fl n
60+
No bold characters, overrides
61+
.Fl b
62+
and
63+
.Fl B
64+
.It Fl o
65+
Use old-style scrolling
66+
.It Fl r
67+
Rainbow mode, rainbow colored characters
68+
.It Fl s
69+
Screensaver mode, exits on first keystroke
70+
.It Fl t Ar tty
71+
Set tty to use
72+
.It Fl u Ar delay
73+
.Sq Ar 4
74+
Screen update delay
75+
.Ar 0 Ns Pf - Ar 9
76+
.It Fl V
77+
Print version information and exit
78+
.It Fl x
79+
X window mode, use if your
80+
.Xr xterm 1
81+
is using mtx.pcf
82+
.El
83+
.Pp
84+
The following keystrokes are available during execution:
85+
.Pp
86+
.Bl -tag -width "! @ # $ % ^ & )" -compact
87+
.It Ic "! @ # $ % ^ & )"
88+
Switch scheme to corresponding
89+
.Ar color :
90+
.Pp
91+
.TS
92+
aw10 aw10.
93+
! red @ green
94+
# yellow $ blue
95+
% magenta ^ cyan
96+
& white ) black
97+
.TE
98+
.Pp
99+
.It Ic 0 Ns Pf - Ic 9
100+
Set update delay
101+
.It Ic a
102+
Toggle asynchronous scroll
103+
.It Ic b
104+
Random bold characters
105+
.It Ic B
106+
All bold characters
107+
.It Ic n
108+
Turn off bold characters
109+
.It Ic p , Ic P
110+
Pause
111+
.It Ic q
112+
Quit
113+
.El
114+
.Sh EXAMPLES
115+
Interactive mode with asynchronous, partially-bold, red rain:
116+
.Dl $ cmatrix -ab -C red -u 2
117+
.Pp
118+
Interactive mode with asynchronous, partially-bold and Japanese rain:
119+
.Dl $ cmatrix -abc
120+
.Pp
121+
Screensaver mode emulating the classic from Windows/Mac:
122+
.Dl $ cmatrix -os
123+
.Pp
124+
Most realistic emulation of original movie:
125+
.Dl $ cmatrix -abcl
126+
.Sh SEE ALSO
127+
.Xr kill 1 ,
128+
.Xr xterm 1 ,
129+
.Xr ncurses 3
130+
.Pp
131+
.Lk http://www.github.com/abishekvashok/cmatrix Homepage
132+
.Sh HISTORY
133+
The
134+
.Nm
135+
utility was originally written by
136+
.An Chris Allegretta Aq Mt [email protected]
137+
for Linux in 1999.
138+
.Sh CAVEATS
139+
This is a fan made project, the Matrix movie is owned by completely
140+
unrelated trademark holders.

cmatrix.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,27 +147,27 @@ void c_die(char *msg, ...) {
147147
}
148148

149149
void usage(void) {
150-
printf(" Usage: cmatrix -[abBcfhlsmVxk] [-u delay] [-C color] [-t tty] [-M message]\n");
150+
printf(" Usage: cmatrix [-\?abBcfhklLmnorsVx] [-C color] [-M message] [-t tty] [-u delay]\n");
151151
printf(" -a: Asynchronous scroll\n");
152152
printf(" -b: Bold characters on\n");
153-
printf(" -B: All bold characters (overrides -b)\n");
154-
printf(" -c: Use Japanese characters as seen in the original matrix. Requires appropriate fonts\n");
155-
printf(" -f: Force the linux $TERM type to be on\n");
156-
printf(" -l: Linux mode (uses matrix console font)\n");
157-
printf(" -L: Lock mode (can be closed from another terminal)\n");
153+
printf(" -B: All bold characters, overrides -b\n");
154+
printf(" -c: Use Japanese characters, requires appropriate font\n");
155+
printf(" -C [color]: \'green\' Use this color\n");
156+
printf(" -f: Force the $TERM type to be on\n");
157+
printf(" -h, \?: Print usage and exit\n");
158+
printf(" -k: Change characters while scrolling, cannot combine with -o\n");
159+
printf(" -l: Linux mode, use matrix console font\n");
160+
printf(" -L: Lock mode, can be kill(1)ed from another terminal\n");
161+
printf(" -m: Lambda mode, every character becomes a lambda\n");
162+
printf(" -M [message]: Add centered message overriding -L's default\n");
163+
printf(" -n: No bold characters, overrides -b and -B\n");
158164
printf(" -o: Use old-style scrolling\n");
159-
printf(" -h: Print usage and exit\n");
160-
printf(" -n: No bold characters (overrides -b and -B, default)\n");
161-
printf(" -s: \"Screensaver\" mode, exits on first keystroke\n");
162-
printf(" -x: X window mode, use if your xterm is using mtx.pcf\n");
163-
printf(" -V: Print version information and exit\n");
164-
printf(" -M [message]: Prints your message in the center of the screen. Overrides -L's default message.\n");
165-
printf(" -u delay (0 - 10, default 4): Screen update delay\n");
166-
printf(" -C [color]: Use this color for matrix (default green)\n");
167-
printf(" -r: rainbow mode\n");
168-
printf(" -m: lambda mode\n");
169-
printf(" -k: Characters change while scrolling. (Works without -o opt.)\n");
165+
printf(" -r: Rainbow mode, rainbow colored characters\n");
166+
printf(" -s: Screensaver mode, exits on first keystroke\n");
170167
printf(" -t [tty]: Set tty to use\n");
168+
printf(" -u [delay]: \'4\' Screen update delay 0-9\n");
169+
printf(" -V: Print version information and exit\n");
170+
printf(" -x: X window mode, use if your xterm(1) is using mtx.pcf\n");
171171
}
172172

173173
void version(void) {

0 commit comments

Comments
 (0)