From e7eb06f7d9d04ab7f20a9da46c6af34a346cfa96 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 24 Jul 2002 22:25:35 +0000 Subject: use Xconfig::xfree to set the XkbLayout (better should&will come) --- perl-install/standalone/keyboarddrake | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'perl-install/standalone/keyboarddrake') diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake index 0ac98cb49..1160fe758 100755 --- a/perl-install/standalone/keyboarddrake +++ b/perl-install/standalone/keyboarddrake @@ -6,7 +6,7 @@ use standalone; #- warning, standalone must be loaded very first, for 'expla use interactive; use keyboard; -use Xconfigurator_consts; +use Xconfig::xfree; use common; use c; @@ -41,24 +41,13 @@ if ($keyboard) { my $xkb = keyboard::keyboard2xkb($keyboard); system('setxkbmap', $xkb); - my $f = "/etc/X11/XF86Config"; - my $g = "/etc/X11/XF86Config-4"; - - substInFile { - if (/^Section\s+"Keyboard"/ .. /^EndSection/) { - s|^(\s*XkbLayout\s+).*|$1"$xkb"| - and $_ .= join '', map { " $_\n" } @{$Xconfigurator::xkb_options{$xkb} || []}; - $_ = '' if m,^(\s*(XkbVariant|XkbOptions)\s+),; # remove existing one - } - } $f if -e $f && !$::testing; - - substInFile { - if (/Identifier\s+"Keyboard1"/ .. /^EndSection/) { - s|^(\s*Option\s+"XkbLayout"\s+).*|$1"$xkb"| - and $_ .= join '', map { /(\S+)(.*)/; qq( Option "$1" $2\n) } @{$Xconfigurator::xkb_options{$xkb} || []}; - $_ = '' if m,^(\s*Option\s+"(XkbVariant|XkbOptions)"\s+),; # remove existing one - } - } $g if -e $g && !$::testing; + eval { + my $xfree_conf = Xconfig::xfree->read; + my $x_kbd_conf = $xfree_conf->get_keyboard; + $x_kbd_conf->{XkbLayout} = $xkb; + $xfree_conf->set_keyboard($x_kbd_conf); + $xfree_conf->write; + }; keyboard::write('', $keyboard, $isNotDelete); } -- cgit v1.2.1