1999-07-29 23:26:08 +04:00
|
|
|
# $NetBSD: rc.wscons,v 1.4 1999/07/29 19:26:08 augustss Exp $
|
1999-03-13 17:54:22 +03:00
|
|
|
|
1999-03-16 01:02:24 +03:00
|
|
|
wscfg=/usr/sbin/wsconscfg
|
|
|
|
wsfld=/usr/sbin/wsfontload
|
|
|
|
config=/etc/wscons.conf
|
|
|
|
usage="Usage: wsconfig [-n] [-f configfile] [-font fontpgm] [-screen screenpgm]"
|
|
|
|
DOIT=
|
1999-03-13 17:54:22 +03:00
|
|
|
|
1999-03-16 01:02:24 +03:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
case $1 in
|
|
|
|
-n)
|
|
|
|
DOIT=echo
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
1999-03-16 01:02:24 +03:00
|
|
|
-f)
|
|
|
|
config=$2
|
|
|
|
shift
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
1999-03-16 01:02:24 +03:00
|
|
|
-font)
|
|
|
|
wsfld=$2
|
|
|
|
shift
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
1999-03-16 01:02:24 +03:00
|
|
|
-screen)
|
|
|
|
wscfg=$2
|
|
|
|
shift
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
|
|
|
*)
|
1999-03-16 01:02:24 +03:00
|
|
|
echo $usage
|
|
|
|
exit 1
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
|
|
|
esac
|
1999-03-16 01:02:24 +03:00
|
|
|
shift
|
1999-03-13 17:54:22 +03:00
|
|
|
done
|
|
|
|
|
|
|
|
|
1999-03-16 01:02:24 +03:00
|
|
|
# args mean:
|
|
|
|
# screen idx scr emul
|
|
|
|
# font name width height enc file
|
|
|
|
( while read type arg1 arg2 arg3 arg4 arg5; do
|
|
|
|
case "$type" in
|
1999-03-13 17:54:22 +03:00
|
|
|
\#*|"")
|
|
|
|
continue
|
|
|
|
;;
|
1999-03-16 01:02:24 +03:00
|
|
|
font)
|
|
|
|
name=$arg1
|
|
|
|
width=$arg2
|
|
|
|
height=$arg3
|
|
|
|
enc=$arg4
|
|
|
|
file=$arg5
|
|
|
|
cmd=$wsfld
|
|
|
|
|
|
|
|
case $width in
|
|
|
|
-)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -w $width"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case $height in
|
|
|
|
-)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -h $height"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case $enc in
|
|
|
|
-)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -e $enc"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
cmd="$cmd -N $name $file"
|
|
|
|
eval $DOIT $cmd
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
1999-03-16 01:02:24 +03:00
|
|
|
screen)
|
|
|
|
idx=$arg1
|
|
|
|
scr=$arg2
|
|
|
|
emul=$arg3
|
|
|
|
cmd=$wscfg
|
|
|
|
|
|
|
|
case $scr in
|
|
|
|
-)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -t $scr"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case $emul in
|
|
|
|
-)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -e $emul"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
cmd="$cmd $idx"
|
|
|
|
eval $DOIT $cmd
|
1999-03-13 17:54:22 +03:00
|
|
|
;;
|
1999-05-15 18:28:14 +04:00
|
|
|
keyboard)
|
|
|
|
kbd=$arg1
|
|
|
|
cmd=$wscfg
|
|
|
|
case $kbd in
|
|
|
|
-|auto)
|
|
|
|
cmd="$cmd -k"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="$cmd -k $kbd"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
eval $DOIT $cmd
|
|
|
|
;;
|
1999-07-29 23:26:08 +04:00
|
|
|
mux)
|
|
|
|
cmd="$wscfg -m $arg1"
|
|
|
|
eval $DOIT $cmd
|
|
|
|
;;
|
1999-03-13 17:54:22 +03:00
|
|
|
esac
|
1999-03-16 01:02:24 +03:00
|
|
|
done ) < $config
|