diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-11-08 16:14:12 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-11-08 18:17:36 +0100 |
commit | f959a5b33a4da88c0965c5955af7eef3d059737d (patch) | |
tree | c6a817a394fce39e53eeb612b49d4cbefd2ff45a | |
parent | c81192f844f42072c976fe826df30109a85f8cb6 (diff) | |
download | drakx-kbd-mouse-x11-f959a5b33a4da88c0965c5955af7eef3d059737d.tar drakx-kbd-mouse-x11-f959a5b33a4da88c0965c5955af7eef3d059737d.tar.gz drakx-kbd-mouse-x11-f959a5b33a4da88c0965c5955af7eef3d059737d.tar.bz2 drakx-kbd-mouse-x11-f959a5b33a4da88c0965c5955af7eef3d059737d.tar.xz drakx-kbd-mouse-x11-f959a5b33a4da88c0965c5955af7eef3d059737d.zip |
simplify
thus getting rid of the remaining perl_checker warnings
-rw-r--r-- | lib/keyboard.pm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/keyboard.pm b/lib/keyboard.pm index 33ca806..968e79d 100644 --- a/lib/keyboard.pm +++ b/lib/keyboard.pm @@ -608,17 +608,17 @@ sub write { qq( Identifier "system-keyboard"\n) . q( MatchIsKeyboard "on"\n); my $isus = $keyboard->{XkbLayout} && $keyboard->{XkbLayout} eq "us"; - if ($keyboard->{XkbLayout} && !$isus) { - $xorgconf .= " Option \"XkbLayout\" \"" . $keyboard->{XkbLayout} . "\"\n"; - } - if ($keyboard->{XkbModel} && (!$isus || $keyboard->{XkbModel} ne "pc105")) { - $xorgconf .= " Option \"XkbModel\" \"" . $keyboard->{XkbModel} . "\"\n"; - } - if ($keyboard->{XkbVariant}) { - $xorgconf .= " Option \"XkbVariant\" \"" . $keyboard->{XkbVariant} . "\"\n"; - } - if ($keyboard->{XkbOptions}) { - $xorgconf .= " Option \"XkbOptions\" \"" . $keyboard->{XkbOptions} . "\"\n"; + # kbd_option => enabled? + my %is_opt_enabled = ( + XkbLayout => sub { !$isus }, + XkbModel => sub { !$isus || $keyboard->{XkbModel} ne "pc105" }, + XkbVariant => sub { 1 }, + XkbOptions => sub { 1 }, + ); + foreach my $opt (keys %is_opt_enabled) { + if ($keyboard->{$opt} && $is_opt_enabled{$opt}) { + $xorgconf .= sprintf(q( Option "%s" "%s"\n), $opt, $keyboard->{$opt}); + } } $xorgconf .= "EndSection\n"; output_p("$::prefix/etc/X11/xorg.conf.d/00-keyboard.conf", $xorgconf); |