2008-03-03 02:44:01 +05:30
|
|
|
#!@PREFIX@/sbin/runscript
|
2008-01-12 00:49:33 +05:30
|
|
|
# Copyright 2008 Roy Marples <roy@marples.name>
|
|
|
|
# All rights reserved. Released under the 2-clause BSD license.
|
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
need localmount
|
2008-03-03 02:43:21 +05:30
|
|
|
keyword noprefix
|
2008-01-12 00:49:33 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
case "${type}" in
|
|
|
|
\#*|"")
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
|
|
|
|
font)
|
|
|
|
cmd=${wsfld}
|
|
|
|
[ "${arg2}" != "-" ] && cmd="${cmd} -w ${arg2}"
|
|
|
|
[ "${arg3}" != "-" ] && cmd="${cmd} -h ${arg3}"
|
|
|
|
[ "${arg4}" != "-" ] && cmd="${cmd} -e ${arg4}"
|
|
|
|
cmd="${cmd} -N ${arg1} ${arg5}"
|
|
|
|
eval "${cmd}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
screen)
|
|
|
|
cmd=${wscfg}
|
|
|
|
[ "${arg2}" != "-" ] && cmd="${cmd} -t ${arg2}"
|
|
|
|
[ "${arg3}" != "-" ] && cmd="${cmd} -e ${arg3}"
|
|
|
|
cmd="${cmd} ${arg1}"
|
|
|
|
eval "${cmd}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
keyboard)
|
|
|
|
cmd=${wscfg}
|
|
|
|
case "${arg1}" in
|
|
|
|
-|auto)
|
|
|
|
cmd="${cmd} -k"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="${cmd} -k ${arg1}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
${cmd}
|
|
|
|
;;
|
|
|
|
|
|
|
|
encoding)
|
|
|
|
eval ${wsctl} -w "\"encoding=${arg1}\""
|
|
|
|
;;
|
|
|
|
|
|
|
|
mapfile)
|
|
|
|
local entry=
|
|
|
|
while read entry; do
|
2008-03-23 17:54:15 +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
|
|
|
*)
|
2008-03-23 17:54:15 +05:30
|
|
|
cmd="${wsctl} -w \"map+=${entry}\""
|
|
|
|
eval "${cmd} >/dev/null"
|
|
|
|
;;
|
|
|
|
esac
|
2008-01-12 00:49:33 +05:30
|
|
|
done < "${arg1}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
mux)
|
|
|
|
eval "${wscfg} -m ${arg1}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
setvar)
|
|
|
|
case "${arg1}" in
|
|
|
|
keyboard)
|
|
|
|
cmd="${wsctl} -kw ${arg2}"
|
|
|
|
;;
|
|
|
|
display)
|
|
|
|
cmd="${wsctl} -dw ${arg2}"
|
|
|
|
;;
|
|
|
|
mouse)
|
|
|
|
cmd="${wsctl} -mw ${arg2}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cmd="${wsctl} -w ${arg1}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
eval "${cmd}"
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
done < "${config}"
|
|
|
|
}
|