projects
/
grml-scripts-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
612a27a
)
grml-lang now modifies the keyboard config file. [Closes: issue437]
author
Ulrich Dangel
<uli@spamt.net>
Sat, 17 Oct 2009 14:27:21 +0000
(16:27 +0200)
committer
Ulrich Dangel
<uli@spamt.net>
Sat, 17 Oct 2009 14:27:21 +0000
(16:27 +0200)
usr_bin/grml-lang
patch
|
blob
|
history
diff --git
a/usr_bin/grml-lang
b/usr_bin/grml-lang
index
19b0b69
..
3376d4c
100755
(executable)
--- a/
usr_bin/grml-lang
+++ b/
usr_bin/grml-lang
@@
-6,16
+6,46
@@
# License: This file is licensed under the GPL v2.
################################################################################
# License: This file is licensed under the GPL v2.
################################################################################
+CONFFILE=/etc/sysconfig/keyboard
+PN="$(basename $0)"
+
usage(){
echo "Usage: $0 <language>"
echo "supported values: at, ch, de, dvorak, es, jp, us"
}
usage(){
echo "Usage: $0 <language>"
echo "supported values: at, ch, de, dvorak, es, jp, us"
}
+setvalue(){
+ [ -n "$2" ] || return 1
+ # already present in conffile?
+ if grep -q ${1} $CONFFILE 2>/dev/null ; then
+ sudo sed -i "s#^${1}.*#${1}=${2}#" $CONFFILE
+ else
+ echo "$1=${2}" | sudo tee -a $CONFFILE >/dev/null
+ fi
+}
+
if [ $# -lt "1" ] ; then
usage
exit -1
fi
if [ $# -lt "1" ] ; then
usage
exit -1
fi
+[ -d /etc/sysconfig ] || sudo mkdir /etc/sysconfig
+
+
+LANGUAGE="$1"
+
+
+. /etc/grml/language-functions
+
+if [ ! -z "$KEYTABLE" ] ; then
+ setvalue KEYTABLE "$KEYTABLE"
+fi
+
+if [ ! -z "XKEYBOARD" ] ; then
+ setvalue XKEYBOARD $XKEYBOARD
+fi
+
+
if [ -z "$DISPLAY" ] ;then
if [ "$1" = "de" ] ; then
echo "Loading keymap for Germany..."
if [ -z "$DISPLAY" ] ;then
if [ "$1" = "de" ] ; then
echo "Loading keymap for Germany..."