SF.net SVN: morphix: [2490] trunk/keybconf/src/keybconf-xkbvariant.sh

[email protected] Sat, 14 Apr 2007 13:18:47 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2490
          http://svn.sourceforge.net/morphix/?rev=2490&view=rev
Author:   alextreme
Date:     2007-04-14 13:18:46 -0700 (Sat, 14 Apr 2007)

Log Message:
-----------
  * adding Than's XkbVariant-modifying patch

Added Paths:
-----------
    trunk/keybconf/src/keybconf-xkbvariant.sh

Added: trunk/keybconf/src/keybconf-xkbvariant.sh
===================================================================
--- trunk/keybconf/src/keybconf-xkbvariant.sh	                        (rev 0)
+++ trunk/keybconf/src/keybconf-xkbvariant.sh	2007-04-14 20:18:46 UTC (rev 2490)
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+[[ "$UID" = "0" ]] || {
+	echo -e "You need to are root for run this application"
+	exit 0
+	}
+
+xorgconf=/etc/X11/xorg.conf
+keybconf.bin
+
+removexkbvariant(){
+sed -i "/^.*XkbVariant.*$/d" $xorgconf
+}
+
+swissde(){
+sed -i "s,^.*XkbLayout.*$,\tOption\t\"XkbLayout\"\t\"ch\"\n\tOption\t\"XkbVariant\"\t\"de\"," $xorgconf
+setxkbmap ch de
+}
+
+swissfr(){
+sed -i "s,^.*XkbLayout.*$,\tOption\t\"XkbLayout\"\t\"ch\"\n\tOption\t\"XkbVariant\"\t\"fr\"," $xorgconf
+setxkbmap ch fr
+}
+
+
+
+removexkbvariant
+grep "XkbLayout" $xorgconf | grep -q "\"ch_de\"" && swissde
+grep "XkbLayout" $xorgconf | grep -q "\"ch_fr\"" && swissfr


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/