Accepting request 835309 from home:sbrabec:branches-kbd-prefer-xkb

- Make kbdsettings working in both bash and dash (boo#1175040).

OBS-URL: https://build.opensuse.org/request/show/835309
OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=128
This commit is contained in:
Stanislav Brabec 2020-09-17 22:53:25 +00:00 committed by Git OBS Bridge
parent f4e6b996a0
commit 03e213cd44
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 17 22:43:16 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Make kbdsettings working in both bash and dash (boo#1175040).
-------------------------------------------------------------------
Thu Sep 17 14:47:04 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>

View File

@ -7,11 +7,12 @@
for i in NUM SCR CAPS; do
conf=$(eval echo KBD_${i}LOCK)
[ -z ${!conf} ] && continue
param=$(echo ${i,,} | sed 's/scr/scroll/')
eval confval=\"\$$conf\"
[ -z "$confval" ] && continue
param=$(echo $i | tr A-Z a-z | sed 's/scr/scroll/')
for tty in ${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}; do
case "${!conf}" in
case "$confval" in
yes)
if [ $param = "num" ]; then
touch /run/numlock-on
@ -35,11 +36,11 @@ for i in NUM SCR CAPS; do
/usr/bin/setleds -D -$param < /dev/$tty
fi
else
echo "Value ${!conf} invalid for $conf"
echo "Value $confval invalid for $conf"
fi
;;
*)
echo "error: unknown value ${!conf} in $conf"
echo "error: unknown value $confval in $conf"
;;
esac
done