summaryrefslogtreecommitdiff
path: root/src/locale/localectl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-11-18 13:42:57 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-11-18 20:35:52 -0500
commit0732ef7acf37473847992888bcb6446726d9d877 (patch)
tree192cc1763bc9f375759ae46ad4e3152d65840472 /src/locale/localectl.c
parent98fce79dea6f653dead88638fc17a27280b1f250 (diff)
localed: match converted keymaps before legacy
Before, X11 keymap fr-pc105-oss would be converted to fr, even though fr-oss exists. Now, if /usr/lib/kbd/keymaps/xkb/<layout>[-<variant>].map[.gz] exists, <layout>[-<variant>] will be used as the console keymap, falling back to the legacy mappings otherwise. % sudo localectl set-x11-keymap pl pc105 % localectl System Locale: LANG=en_US.UTF-8 VC Keymap: pl (was pl2 before) X11 Layout: pl X11 Model: pc105 % sudo localectl set-x11-keymap fr pc105 oss % localectl System Locale: LANG=en_US.UTF-8 VC Keymap: fr-oss (was fr before) X11 Layout: fr X11 Model: pc105 X11 Variant: oss % sudo localectl set-x11-keymap fr pc105 % localectl System Locale: LANG=en_US.UTF-8 VC Keymap: fr X11 Layout: fr X11 Model: pc105 % sudo localectl set-x11-keymap gb % localectl System Locale: LANG=en_US.UTF-8 VC Keymap: gb (was uk before) X11 Layout: gb
Diffstat (limited to 'src/locale/localectl.c')
-rw-r--r--src/locale/localectl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index f7fea48ffe..76a53f6fff 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -42,6 +42,7 @@
#include "set.h"
#include "path-util.h"
#include "utf8.h"
+#include "def.h"
static bool arg_no_pager = false;
static bool arg_ask_password = true;
@@ -437,15 +438,14 @@ static int nftw_cb(
static int list_vconsole_keymaps(sd_bus *bus, char **args, unsigned n) {
_cleanup_strv_free_ char **l = NULL;
+ const char *dir;
keymaps = set_new(string_hash_func, string_compare_func);
if (!keymaps)
return log_oom();
- nftw("/usr/share/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
- nftw("/usr/share/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
- nftw("/usr/lib/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
- nftw("/lib/kbd/keymaps/", nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
+ NULSTR_FOREACH(dir, KBD_KEYMAP_DIRS)
+ nftw(dir, nftw_cb, 20, FTW_MOUNT|FTW_PHYS);
l = set_get_strv(keymaps);
if (!l) {