diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-09-28 04:25:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-09-28 04:34:17 +0200 |
commit | fb9de93dd3587e62e0fc0413673c98ea709c5a2f (patch) | |
tree | 96baa58676cc78e41db18901ea6b16dfad783f7f /src/generate-kbd-model-map | |
parent | 958ae0d75176a65dc6694829667a5cc9fead8cbc (diff) |
localed: add SetX11Keyboard() and SetVConsoleKeyboard() bus calls
Diffstat (limited to 'src/generate-kbd-model-map')
-rwxr-xr-x | src/generate-kbd-model-map | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/generate-kbd-model-map b/src/generate-kbd-model-map new file mode 100755 index 0000000000..4fcf785e10 --- /dev/null +++ b/src/generate-kbd-model-map @@ -0,0 +1,49 @@ +#!/usr/bin/python + +import system_config_keyboard.keyboard_models, sys + +def strdash(s): + r = s.strip() + + if r == "": + return "-" + + return r + +def tab_extend(s, n = 1): + + s = strdash(s) + k = len(s) / 8 + + if k >= n: + f = 1 + else: + f = n - k + + for x in range(0, f): + s = s + "\t" + + return s + + + +models = system_config_keyboard.keyboard_models.KeyboardModels().get_models() + +print "# Generated from system-config-keyboard's model list" + +print "# consolelayout\t\txlayout\txmodel\t\txvariant\txoptions" + +k = models.keys() + +k.reverse() + +for key in k: + value = models[key] + + options = value[4] + if len(options) > 0: + options = "terminate:ctrl_alt_bksp," + options + else: + options = "terminate:ctrl_alt_bksp" + + print "%s%s%s%s%s" % (tab_extend(key, 3), tab_extend(value[1]), tab_extend(value[2], 2), tab_extend(value[3], 2), options) |