summaryrefslogtreecommitdiff
path: root/src/locale/generate-kbd-model-map
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-11-15 10:10:41 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-11-15 10:10:41 -0500
commit2944f347d087ff24ec808e4b70fe104a772a97a0 (patch)
treea5de4fbefe16ef359a526442fb41251f123399d5 /src/locale/generate-kbd-model-map
parent678b0b89572768b21d8b74360d55b75b233799c4 (diff)
parentd025f1e4dca8fc1436aff76f9e6185fe3e728daa (diff)
Fork of Original Code Base: anongit.freedesktop.org/systemd
This is the initial fork of the code base from freedsktop.org. The code is provided here as a reference of the initial starting point and for possible future checkouts after a large portion of this code is removed. Merge git://anongit.freedesktop.org/systemd/systemd
Diffstat (limited to 'src/locale/generate-kbd-model-map')
-rwxr-xr-xsrc/locale/generate-kbd-model-map33
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))