2008-03-03 02:44:01 +05:30
|
|
|
#!@PREFIX@/sbin/runscript
|
2009-05-01 19:41:40 +05:30
|
|
|
# Copyright (c) 2008-2009 Roy Marples <roy@marples.name>
|
2011-06-30 05:16:31 +05:30
|
|
|
# Released under the 2-clause BSD license.
|
2008-01-12 00:49:33 +05:30
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
need localmount
|
|
|
|
}
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
wscfg=/usr/sbin/wsconscfg
|
|
|
|
wsfld=/usr/sbin/wsfontload
|
|
|
|
wsctl=/sbin/wsconsctl
|
|
|
|
config=/etc/wscons.conf
|
|
|
|
|
|
|
|
# args mean:
|
|
|
|
# screen idx scr emul
|
|
|
|
# font name width height enc file
|
|
|
|
while read type arg1 arg2 arg3 arg4 arg5; do
|
2009-04-27 13:21:18 +05:30
|
|
|
case "$type" in
|
2008-01-12 00:49:33 +05:30
|
|
|
\#*|"")
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
|
|
|
|
font)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd=$wsfld
|
|
|
|
[ "$arg2" != "-" ] && cmd="$cmd -w $arg2"
|
2011-01-17 15:19:07 +05:30
|
|
|
[ "$arg3" != "-" ] && cmd="$cmd -h $arg3"
|
2009-04-27 13:21:18 +05:30
|
|
|
[ "$arg4" != "-" ] && cmd="$cmd -e $arg4"
|
|
|
|
cmd="$cmd -N $arg1 $arg5"
|
2011-01-17 15:19:07 +05:30
|
|
|
eval "$cmd"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
screen)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd=$wscfg
|
|
|
|
[ "$arg2" != "-" ] && cmd="$cmd -t $arg2"
|
|
|
|
[ "$arg3" != "-" ] && cmd="$cmd -e $arg3"
|
|
|
|
cmd="$cmd $arg1"
|
|
|
|
eval "$cmd"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
keyboard)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd=$wscfg
|
|
|
|
case "$arg1" in
|
2008-01-12 00:49:33 +05:30
|
|
|
-|auto)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$cmd -k"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
*)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$cmd -k $arg1"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
esac
|
2009-04-27 13:21:18 +05:30
|
|
|
$cmd
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
encoding)
|
2009-04-27 13:21:18 +05:30
|
|
|
eval $wsctl -w "\"encoding=$arg1\""
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
mapfile)
|
|
|
|
local entry=
|
|
|
|
while read entry; do
|
2009-04-27 13:21:18 +05:30
|
|
|
case "$entry" in
|
2008-01-12 00:49:33 +05:30
|
|
|
\#*|"")
|
2008-03-23 17:54:15 +05:30
|
|
|
continue
|
|
|
|
;;
|
2008-01-12 00:49:33 +05:30
|
|
|
*)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$wsctl -w \"map+=$entry\""
|
|
|
|
eval "$cmd >/dev/null"
|
2008-03-23 17:54:15 +05:30
|
|
|
;;
|
|
|
|
esac
|
2009-04-27 13:21:18 +05:30
|
|
|
done < "$arg1"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
mux)
|
2009-04-27 13:21:18 +05:30
|
|
|
eval "$wscfg -m $arg1"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
setvar)
|
2009-04-27 13:21:18 +05:30
|
|
|
case "$arg1" in
|
2008-01-12 00:49:33 +05:30
|
|
|
keyboard)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$wsctl -kw $arg2"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
display)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$wsctl -dw $arg2"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
mouse)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$wsctl -mw $arg2"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
*)
|
2009-04-27 13:21:18 +05:30
|
|
|
cmd="$wsctl -w $arg1"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
esac
|
2009-04-27 13:21:18 +05:30
|
|
|
eval "$cmd"
|
2008-01-12 00:49:33 +05:30
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2009-04-27 13:21:18 +05:30
|
|
|
done < "$config"
|
2008-01-12 00:49:33 +05:30
|
|
|
}
|