diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-01-02 16:50:03 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-01-03 21:08:57 +0100 |
commit | 776a564f54dd54c7c4e2b2d865e8f9e7ee5404f3 (patch) | |
tree | 67a49d6cf5c5fa28cb54c151bf6060c4b80a25c8 /src/locale/generate-kbd-model-map | |
parent | b4d0195b0598df76d30f006507fa8466f5a5d330 (diff) |
build-sys: move kbd-model-map to locale/
Diffstat (limited to 'src/locale/generate-kbd-model-map')
-rwxr-xr-x | src/locale/generate-kbd-model-map | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/locale/generate-kbd-model-map b/src/locale/generate-kbd-model-map new file mode 100755 index 0000000000..624c5179fa --- /dev/null +++ b/src/locale/generate-kbd-model-map @@ -0,0 +1,33 @@ +#!/usr/bin/python + +import sys +import system_config_keyboard.keyboard_models + +def strdash(s): + return s.strip() or '-' + +def tab_extend(s, n=1): + s = strdash(s) + k = len(s) // 8 + + if k >= n: + f = 1 + else: + f = n - k + + return s + '\t'*f + + +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" + +for key, value in reversed(models.items()): + options = "terminate:ctrl_alt_bksp" + if value[4]: + options += ',' + value[4] + + print ''.join((tab_extend(key, 3), tab_extend(value[1]), + tab_extend(value[2], 2), tab_extend(value[3], 2), + options)) |