2013-12-22 02:21:11 +05:30
|
|
|
#!@SBINDIR@/openrc-run
|
2015-12-05 04:22:19 +05:30
|
|
|
# Copyright (c) 2007-2015 The OpenRC Authors.
|
|
|
|
# See the Authors file at the top-level directory of this distribution and
|
2021-12-21 06:37:00 +05:30
|
|
|
# https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS
|
2015-12-05 04:22:19 +05:30
|
|
|
#
|
|
|
|
# This file is part of OpenRC. It is subject to the license terms in
|
|
|
|
# the LICENSE file found in the top-level directory of this
|
2021-12-21 06:37:00 +05:30
|
|
|
# distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE
|
2015-12-05 04:22:19 +05:30
|
|
|
# This file may not be copied, modified, propagated, or distributed
|
|
|
|
# except according to the terms contained in the LICENSE file.
|
2008-01-12 00:49:33 +05:30
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
2017-03-16 20:46:39 +05:30
|
|
|
after clock
|
2008-01-12 00:49:33 +05:30
|
|
|
need localmount
|
2012-07-03 08:34:22 +05:30
|
|
|
keyword -prefix
|
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
|
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
|
|
|
}
|