# License: This file is licensed under the GPL v2.
################################################################################
# License: This file is licensed under the GPL v2.
################################################################################
echo "supported values: at, ch, de, dvorak, es, fr, it, jp, us"
}
setvalue(){
[ -n "$2" ] || return 1
echo "supported values: at, ch, de, dvorak, es, fr, it, 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
+ sudo sed -i "s#^${1}=.*#${1}=\"${2}\"#" "${CONFFILE}"
-if [ ! -z "$KEYTABLE" ] ; then
- setvalue KEYTABLE "$KEYTABLE"
-fi
-
-if [ ! -z "XKEYBOARD" ] ; then
- setvalue XKEYBOARD $XKEYBOARD
+if [ -n "$XKEYBOARD" ] ; then
+ setvalue XKBLAYOUT "$XKEYBOARD"
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..."