[Pkg-utopia-maintainers] Bug#524098: xserver-xorg: dependency on console-setup broke keyboard settings

martin f krafft madduck at debian.org
Fri May 8 19:08:04 UTC 2009


also sprach Michael Biebl <biebl at teco.edu> [2009.04.20.1440 +0200]:
> Maybe there is another way (totally untested though).
> You remove the xkb keys in debian-x11-keymap.fdi, with something like
>
> <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
> <deviceinfo version="0.2">
>   <device>
>     <match key="info.capabilities" contains="input.keys">
>         <remove key="input.xkb.layout" type="string"/>
>         <remove key="input.xkb.variant" type="string"/>
>       </match>
>   </device>
> </deviceinfo>
>
> This *should* still preserve user configuration in /etc/hal/fdi and would 
> allow the debian-setup-keyboard script to check, if those values are empty 
> and only modify them if so.

This seemed like a sensible suggestion and so I went ahead to try
it, yielding #524098.

The files I used are attached for further use. Until I figure out
how to query the HAL database from a HAL callout script (who
designed this???), I am afraid this solution isn't feasible though.

-- 
 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"life moves pretty fast. if you don't stop and look around once in
 a while, you could miss it."
                                                     -- ferris bueller
-------------- next part --------------
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
    <device>
	<match key="input.xkb.layout" exists="true">
	  <append key="info.callouts.add" type="strlist">debian-setup-keyboard</append>
	  <remove key="input.xkb.rules"/>
	  <remove key="input.xkb.model"/>
	  <remove key="input.xkb.layout"/>
	  <remove key="input.xkb.variant"/>
	</match>
    </device>
</deviceinfo>


-------------- next part --------------
#!/bin/bash
#
# based on work by Fedora and modified to work with console-setup
#
# Copyright ? 2009 martin f. krafft <madduck at debian.org>
#

[ -x /usr/bin/hal-set-property ] || exit 0
[ -x /usr/bin/hal-get-property ] || exit 0

set -x
exec 2>> /tmp/hal.stderr.${UDI//\//__}

. /etc/default/console-setup > /dev/null 2>&1 || exit 0

hal_set_xkb_param_if_empty () {
    local key; key="$1"
    local type; type="$2"
    local target; target="$3"
    local value
    value=$(hal-get-property --udi "$UDI" --key input.xkb.$key)
    case "$value/$target" in
        */) # no new value, so delete
            hal-set-property --direct --udi "$UDI" --key input.xkb.$key --remove
            ;;
        /?*) # current value empty, new value exists
            hal-set-property --direct --udi "$UDI" --key input.xkb.$key --$type "$target"
            ;;
        ?*/*) # has current value, ignore
            ;;
    esac
}

hal_set_xkb_param_if_empty model string $XKBMODEL
hal_set_xkb_param_if_empty layout string $XKBLAYOUT
hal_set_xkb_param_if_empty variant string $XKBVARIANT
hal_set_xkb_param_if_empty options string $XKBOPTIONS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20090508/0820871e/attachment.pgp>


More information about the Pkg-utopia-maintainers mailing list