From 4b3f9c805f7ac68fba2d27f0252c00481309cf43 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 8 Feb 2015 16:47:35 +0000 Subject: ensure i18n settings are written to xorg.conf.d snippet In an ideal world we'd use the localed daemon to write this file for us (thus hiding the implementation detail) but this will not work from the installer context so for now just do it manually. Longer term, all manual stuff should be killed off and we should find a way to make installed and installer contexts both work with dbus services. --- NEWS | 1 + lib/keyboard.pm | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/NEWS b/NEWS index 0fcf0fc..4ac20ae 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- ensure i18n settings are written to xorg.conf.d snippet - write KEYMAP to /etc/vconsole.conf Version 1.4 - 2 January 2015 diff --git a/lib/keyboard.pm b/lib/keyboard.pm index 6c4641d..1d7070f 100644 --- a/lib/keyboard.pm +++ b/lib/keyboard.pm @@ -622,6 +622,26 @@ sub write { addVarsInShMode("$::prefix/etc/vconsole.conf", 0644, $h2); } + my $xorgconf = "# Read and parsed by systemd-localed. It's probably wise not to edit this file\n" . + "# manually too freely.\n" . + "Section \"InputClass\"\n" . + " Identifier \"system-keyboard\"\n" . + " MatchIsKeyboard \"on\"\n"; + if ($keyboard->{'XkbLayout'}) { + $xorgconf .= " Option \"XkbLayout\" \"" . $keyboard->{'XkbLayout'} . "\"\n"; + } + if ($keyboard->{'XkbModel'}) { + $xorgconf .= " Option \"XkbModel\" \"" . $keyboard->{'XkbModel'} . "\"\n"; + } + if ($keyboard->{'XkbVariant'}) { + $xorgconf .= " Option \"XkbModel\" \"" . $keyboard->{'XkbVariant'} . "\"\n"; + } + if ($keyboard->{'XkbOptions'}) { + $xorgconf .= " Option \"XkbOptions\" \"" . $keyboard->{'XkbOptions'} . "\"\n"; + } + $xorgconf .= "EndSection\n"; + output_p("$::prefix/etc/X11/xorg.conf.d/00-keyboard.conf", $xorgconf); + if (arch() =~ /ppc/) { my $s = "dev.mac_hid.keyboard_sends_linux_keycodes = 1\n"; substInFile { -- cgit v1.2.1