aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>1995-01-12 11:47:05 +0000
committerSøren Schmidt <sos@FreeBSD.org>1995-01-12 11:47:05 +0000
commit6378775666543dbab8aedabfcb67bc289d1aefde (patch)
tree4740a2fc78a60464f13d1978d7d296c90dc2b652 /usr.sbin
parent9d68e93aafbdac4bf3b12086810426d2749be60f (diff)
Notes
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.110
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c54
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.118
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c61
4 files changed, 74 insertions, 69 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1
index 645103675f4ea..40c31d1d3ed65 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.1
+++ b/usr.sbin/kbdcontrol/kbdcontrol.1
@@ -31,7 +31,12 @@ characteristics etc.
The following command line options are supported.
.TP
.BI "\-b\ " [ duration.pitch ]
-Set the bell duration and pitch values.
+Set the bell duration and pitch values. Argument may also be one of
+.BI "normal"
+which set sound parameters back to normal values, or
+.BI "visual"
+which set the bell to visual mode, ie flashes the screen instead.
+
.TP
.BI "\-r\ " [ delay.repeat | slow | fast | normal ]
Set keyboard
@@ -72,6 +77,5 @@ Report when found.
.BR vidcontrol (1) ,
.BR keyboard (4) ,
.BR screen (4) ,
-.BR /sys/i386/conf/SYSCONS
.SH AUTHORS
-Søren Schmidt (sos@login.dkuug.dk)
+Søren Schmidt (sos@FreeBSD.org)
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index 24349ae471b28..96795230f51c5 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994 Søren Schmidt
+ * Copyright (c) 1994-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kbdcontrol.c,v 1.1 1994/08/17 08:59:34 sos Exp $
+ * $Id: kbdcontrol.c,v 1.2 1994/10/25 20:50:41 swallace Exp $
*/
#include <ctype.h>
@@ -86,10 +86,9 @@ nextarg(int ac, char **av, int *indp, int oc)
char *
mkfullname(const char *s1, const char *s2, const char *s3)
{
-static char *buf = NULL;
-static int bufl = 0;
-int f;
-
+ static char *buf = NULL;
+ static int bufl = 0;
+ int f;
f = strlen(s1) + strlen(s2) + strlen(s3) + 1;
if (f > bufl)
@@ -421,14 +420,17 @@ set_functionkey(char *keynumstr, char *string)
void
set_bell_values(char *opt)
{
- int duration, pitch;
+ int bell, duration, pitch;
- if (!strcmp(opt, "normal"))
- duration = 1, pitch = 15;
+ if (!strcmp(opt, "visual"))
+ bell = 1, duration = 1, pitch = 800;
+ else if (!strcmp(opt, "normal"))
+ bell = 0, duration = 1, pitch = 800;
else {
int n;
char *v1;
-
+
+ bell = 0;
duration = strtol(opt, &v1, 0);
if ((duration < 0) || (*v1 != '.'))
goto badopt;
@@ -443,9 +445,14 @@ badopt:
}
if (verbose)
- fprintf(stderr, "setting bell values to %d.%d\n",
- duration, pitch);
- fprintf(stderr, "[=%d;%dB", pitch, duration);
+ if (bell)
+ fprintf(stderr, "setting visual bell\n");
+ else
+ fprintf(stderr, "setting bell values to %d.%d\n",
+ duration, pitch);
+ ioctl(0, CONS_BELLTYPE, &bell);
+ if (!bell)
+ fprintf(stderr, "[=%d;%dB", pitch, duration);
}
@@ -501,16 +508,17 @@ badopt:
usage()
{
fprintf(stderr,
-"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
-" -d (dump keyboard map to stdout)\n"
-" -l filename (load keyboard map file)\n"
-" -f <N> string (set function key N to send <string>)\n"
-" -F (set function keys back to default)\n"
-" -r delay.repeat (set keyboard delay & repeat rate)\n"
-" -r slow (set keyboard delay & repeat to slow)\n"
-" -r normal (set keyboard delay & repeat to normal)\n"
-" -r fast (set keyboard delay & repeat to fast)\n"
-" -v (verbose)\n"
+"Usage: kbdcontrol -b duration.pitch (set bell duration & pitch)\n"
+" -b normal | visual (set bell to visual type)\n"
+" -d (dump keyboard map to stdout)\n"
+" -l filename (load keyboard map file)\n"
+" -f <N> string (set function key N to send <string>)\n"
+" -F (set function keys back to default)\n"
+" -r delay.repeat (set keyboard delay & repeat rate)\n"
+" -r slow (set keyboard delay & repeat to slow)\n"
+" -r normal (set keyboard delay & repeat to normal)\n"
+" -r fast (set keyboard delay & repeat to fast)\n"
+" -v (verbose)\n"
);
}
diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1
index f3ac429bc911b..c257539137581 100644
--- a/usr.sbin/vidcontrol/vidcontrol.1
+++ b/usr.sbin/vidcontrol/vidcontrol.1
@@ -30,10 +30,12 @@ screensaver type and timeout.
A new video mode is selected by specifying its name as an argument to
.B vidcontrol
eg. "
-.B vidcontrol 80x25
+.B vidcontrol VGA_80x25
".
-The modes currently supported: 80x25 and 80x50 text.
+The modes currently supported: VGA_40x25, VGA_80x25, VGA_80x50, EGA_80x25, EGA_80x43.
+On some laptops the modes VGA_80x30 and VGA_80x60 can be used.
+The graphic mode VGA_320x200 can also be chosen.
The colors used when displaying text can be changed by specifying the
foreground color (eg. "
@@ -63,13 +65,8 @@ Set border color to
.B color
(only supported on VGA hardware):
.TP
-.BI "\-c\ " start.end
-Change the cursor apperance. The cursor is changed to a shape that starts
-on scanline
-.B start
-and ends on scanline
-.B end
-.
+.BI "\-c\ " blink | noblink
+Change the cursor apperance. The cursor is either blinking or nonblinking.
.TP
.BI "\-d\ "
Print out current screen output map.
@@ -112,7 +109,6 @@ Report when found.
.BR kbdcontrol(1) ,
.BR keyboard (4) ,
.BR screen (4) ,
-.BR /sys/i386/conf/GENERICAH
.SH AUTHORS
-Søren Schmidt (sos@login.dkuug.dk)
+Søren Schmidt (sos@FreeBSD.org)
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 6aece126f7b2c..cb9ff357bccb7 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1994 Søren Schmidt
+ * Copyright (c) 1994-1995 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: vidcontrol.c,v 1.2 1994/09/15 07:28:06 sos Exp $
+ * $Id: vidcontrol.c,v 1.3 1994/09/26 20:20:44 ache Exp $
*/
#include <ctype.h>
@@ -264,26 +264,19 @@ set_screensaver_type(char *type)
}
void
-set_cursor_values(char *size)
+set_cursor_type(char *appearence)
{
- int start, end;
- int n;
- char *v1;
+ int type;
- start = strtol(size, &v1, 0);
- if ((start < 0) || (*v1 != '.'))
- goto badopt;
- size = ++v1;
- end = strtol(size, &v1, 0);
- if ((end < 0) || (*size == '\0') || (*v1 != '\0')) {
-badopt:
- fprintf(stderr,
- "argument to -c must be start.end\n");
+ if (!strcmp(appearence, "blink"))
+ type = 1;
+ else if (!strcmp(appearence, "noblink"))
+ type = 0;
+ else {
+ fprintf(stderr, "argument to -c must be blink or noblink\n");
return;
}
- if (verbose)
- fprintf(stderr, "setting cursor to %d.%d\n", start, end);
- fprintf(stdout, "[=%d;%dC", start, end);
+ ioctl(0, CONS_CURSORTYPE, &type);
}
@@ -297,8 +290,12 @@ video_mode(int argc, char **argv, int *index)
mode = SW_VGA_C40x25;
else if (!strcmp(argv[*index], "VGA_80x25"))
mode = SW_VGA_C80x25;
+ else if (!strcmp(argv[*index], "VGA_80x30"))
+ mode = SW_VGA_C80x30;
else if (!strcmp(argv[*index], "VGA_80x50"))
mode = SW_VGA_C80x50;
+ else if (!strcmp(argv[*index], "VGA_80x60"))
+ mode = SW_VGA_C80x60;
else if (!strcmp(argv[*index], "VGA_320x200"))
mode = SW_VGA_CG320;
else if (!strcmp(argv[*index], "EGA_80x25"))
@@ -397,18 +394,18 @@ usage()
"Usage: vidcontrol mode (available modes: VGA_40x25, VGA_80x25,\n"
" VGA_80x50, VGA_320x200,\n"
" EGA_80x25, EGA_80x43)\n"
-" show (show available colors)\n"
-" fgcol bgcol (set fore- & background colors)\n"
-" -r fgcol bgcol (set reverse fore- & background colors)\n"
-" -b color (set border color)\n"
-" -c n.m (set cursor start line n & end line m)\n"
-" -d (dump screenmap to stdout)\n"
-" -l filename (load srceenmap file filename)\n"
-" -L (load default screenmap)\n"
-" -f DxL filename (load font, D dots wide & L lines high)\n"
-" -s saver | help (set screensaver type or help for a list)\n"
-" -t N (set screensaver timeout in seconds)\n"
-" -x (use hex numbers for output)\n"
+" show (show available colors)\n"
+" fgcol bgcol (set fore- & background colors)\n"
+" -r fgcol bgcol (set reverse fore- & background colors)\n"
+" -b color (set border color)\n"
+" -c blink | noblink (set cursor type)\n"
+" -d (dump screenmap to stdout)\n"
+" -l filename (load srceenmap file filename)\n"
+" -L (load default screenmap)\n"
+" -f DxL filename (load font, D dots wide & L lines high)\n"
+" -s saver | help (set screensaver type or help for a list)\n"
+" -t N (set screensaver timeout in seconds)\n"
+" -x (use hex numbers for output)\n"
);
}
@@ -423,13 +420,13 @@ main(int argc, char **argv)
info.size = sizeof(info);
if (ioctl(0, CONS_GETINFO, &info) < 0) {
- perror("Must be on a vty");
+ perror("Must be on a vrtual console");
exit(1);
}
while((opt = getopt(argc, argv, "b:c:df:l:Lr:s:t:vx")) != -1)
switch(opt) {
case 'c':
- set_cursor_values(optarg);
+ set_cursor_type(optarg);
break;
case 'b':
set_border_color(optarg);