| 153 | | if ! exists $cfg; then warning "$cfg not found"; return; fi |
|---|
| 154 | | if ! grep -q evtouch $cfg; then |
|---|
| 155 | | sed -i -e 's/Section "ServerLayout"/Section "ServerLayout"\n\tInputDevice\t"touchscreen"/g' $cfg |
|---|
| 156 | | cat <<EOF >> $cfg |
|---|
| | 153 | if ! exists $cfg; then warning "$cfg not found"; return; fi |
|---|
| | 154 | del_key "[[:blank:]]*InputDevice[[:blank:]]\+\"touchscreen\"" $cfg |
|---|
| | 155 | set_key "Section \"ServerLayout" "\"" "\n\tInputDevice\t\"touchscreen\"" $cfg |
|---|
| | 156 | |
|---|
| | 157 | perl -e 'open(FILE, "/etc/X11/xorg.conf"); while ($line = <FILE>) {if ($line =~ /^Section "InputDevice"/) {$buffer = $line;$flag = 0;until ($line =~ /^EndSection/) {$line = <FILE>; $buffer .= $line; if ($line =~ /^.*Identifier "touchscreen"/) {$flag = 1;};}; if ($flag == 0) {print $buffer;};} else {print "$line";};};close(FILE);'> $cfg.tmp |
|---|
| | 158 | mv $cfg.tmp $cfg |
|---|
| | 159 | if [ -z "$(tail -1 $cfg)" ]; then |
|---|
| | 160 | sed '$d' < $cfg > $cfg.tmp |
|---|
| | 161 | mv $cfg.tmp $cfg |
|---|
| | 162 | fi |
|---|
| | 163 | |
|---|
| | 164 | cat <<EOF >> $cfg |
|---|