16 ( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions ) = getXkbSettings();
21 my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
23 open (XPROP, "xprop -root |") or die "Could not start xprop";
26 if (/_XKB_RULES_NAMES\(STRING\) = \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\", \"(.*)\"/)
28 ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) =
29 ( $1, $2, $3, $4, $5 ) ;
35 return ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions );
40 my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
41 ( system ( "setxkbmap", "-synch",
44 "-layout", $xkbLayouts,
45 "-variant", $xkbVariants,
46 "-option", $xkbOptions ) == 0 ) or die "Could not set xkb configuration";
50 sub restoreXkbSettings
52 setXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
55 sub defaultXkbSettings
57 return ( "base", "pc105", "us", "", "" );
62 my ( $xkbRules, $xkbModel, $xkbLayouts, $xkbVariants, $xkbOptions ) = @_;
63 print "rules: [$xkbRules]\n" ;
64 print "model: [$xkbModel]\n" ;
65 print "layouts: [$xkbLayouts]\n" ;
66 print "variants: [$xkbVariants]\n" ;
67 print "options: [$xkbOptions]\n" ;
70 sub dumpXkbSettingsBackup
72 dumpXkbSettings( $origXkbRules, $origXkbModel, $origXkbLayouts, $origXkbVariants, $origXkbOptions );
77 my ( $type, $idx ) = @_;
79 open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
80 die ( "Could not start xsltproc" );
87 print "--- setting $type: [$paramValue]\n";
88 my @params = defaultXkbSettings();
89 $params[$idx] = $paramValue;
90 dumpXkbSettings ( @params );
91 setXkbSettings ( @params );
93 #dumpXkbSettings( getXkbSettings() );
101 my ( $type, $subtype, $idx, $delim1, $delim2, $ifCheckLevel1, $ifAddLevel1, $ifResetToDefault ) = @_;
103 open ( XSLTPROC, "xsltproc --stringparam type $type listCIs.xsl ../rules/base.xml.in |" ) or
104 die ( "Could not start xsltproc" );
111 print "--- scanning $type: [$paramValue]\n";
113 if ( $ifCheckLevel1 )
115 my @params = defaultXkbSettings();
116 if ( $ifResetToDefault )
118 setXkbSettings ( @params );
120 $params[$idx] = "$paramValue";
121 dumpXkbSettings ( @params );
122 setXkbSettings ( @params );
123 #print "--- dump:\n";
124 #dumpXkbSettings( getXkbSettings() );
127 open ( XSLTPROC2, "xsltproc --stringparam type $subtype --stringparam parentId $paramValue listCI2.xsl ../rules/base.xml.in |" ) or
128 die ( "Could not start xsltproc" );
135 print " --- $subtype: [$paramValue2]\n";
136 my @params = defaultXkbSettings();
137 if ( $ifResetToDefault )
139 setXkbSettings ( @params );
143 $params[$idx] = "$paramValue$delim1$paramValue2$delim2";
147 $params[$idx] = "$paramValue2";
149 dumpXkbSettings ( @params );
150 setXkbSettings ( @params );
151 #print "--- dump:\n";
152 #dumpXkbSettings( getXkbSettings() );