summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-23 13:01:55 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-23 13:01:55 +0000
commit673787cbdab4a47b0b3cb987866c57704d7bdee9 (patch)
tree32255ffefd59a78b5e798e18a4f790b032449c1b /perl-install/Xconfig.pm
parent57ea24fde5f61bb54bee187847f1119b5c79f9f3 (diff)
downloaddrakx-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar
drakx-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.gz
drakx-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.bz2
drakx-673787cbdab4a47b0b3cb987866c57704d7bdee9.tar.xz
drakx-673787cbdab4a47b0b3cb987866c57704d7bdee9.zip
no_comment
Diffstat (limited to 'perl-install/Xconfig.pm')
-rw-r--r--perl-install/Xconfig.pm37
1 files changed, 19 insertions, 18 deletions
diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm
index 042388e85..248cf125f 100644
--- a/perl-install/Xconfig.pm
+++ b/perl-install/Xconfig.pm
@@ -18,15 +18,16 @@ sub keymap_translate {
sub getinfo {
my $o = {};
- getinfoFromXF86Config($o);
+# getinfoFromXF86Config($o);
getinfoFromSysconfig($o);
- unless ($o->{mouse}->{xtype}) {
+ unless ($o->{mouse}{xtype}) {
my ($type, $dev) = split("\n", `mouseconfig --nointeractive 2>/dev/null`) or die "mouseconfig failed";
- $o->{mouse}->{xtype} ||= $type;
- $o->{mouse}->{device} ||= "/dev/$dev";
+ $o->{mouse}{emulate3buttons} = 1;
+ $o->{mouse}{xtype} ||= $type;
+ $o->{mouse}{device} ||= "/dev/$dev";
}
- $o->{mouse}->{device} ||= "/dev/mouse" if -e "/dev/mouse";
+ $o->{mouse}{device} ||= "/dev/mouse" if -e "/dev/mouse";
$o;
}
@@ -34,16 +35,16 @@ sub getinfoFromXF86Config {
my $o = shift || {};
my (%c, $depth);
- $o->{card}->{server} ||= $1 if readlink("/etc/X11/X") =~ /XF86_ (\w+)$/x; # /x for perl2fcalls
+ $o->{card}{server} ||= $1 if readlink("/etc/X11/X") =~ /XF86_ (\w+)$/x; # /x for perl2fcalls
local *F;
open F, "/etc/X11/XF86Config" or return {};
foreach (<F>) {
if (/^Section "Keyboard"/ .. /^EndSection/) {
- $o->{keyboard}->{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/;
+ $o->{keyboard}{xkb_keymap} ||= $1 if /^\s*XkbLayout\s+"(.*?)"/;
} elsif (/^Section "Pointer"/ .. /^EndSection/) {
- $o->{mouse}->{xtype} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
- $o->{mouse}->{device} ||= $1 if /^\s*Device\s+"(.*?)"/;
+ $o->{mouse}{xtype} ||= $1 if /^\s*Protocol\s+"(.*?)"/;
+ $o->{mouse}{device} ||= $1 if /^\s*Device\s+"(.*?)"/;
} elsif (my $i = /^Section "Device"/ .. /^EndSection/) {
if ($i = 1 && $c{type} && $c{type} ne "Generic VGA") {
add2hash($o->{card} ||= {}, \%c);
@@ -56,19 +57,19 @@ sub getinfoFromXF86Config {
push @{$c{lines}}, $_ unless /(Section|Identifier|VideoRam|VendorName|BoardName)/;
} elsif (/^Section "Monitor"/ .. /^EndSection/) {
- $o->{monitor}->{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/;
- $o->{monitor}->{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/;
- $o->{monitor}->{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/;
- $o->{monitor}->{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/;
- $o->{monitor}->{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/;
+ $o->{monitor}{type} ||= $1 if /^\s*Identifier\s+"(.*?)"/;
+ $o->{monitor}{hsyncrange} ||= $1 if /^\s*HorizSync\s+(.*)/;
+ $o->{monitor}{vsyncrange} ||= $1 if /^\s*VertRefresh\s+(.*)/;
+ $o->{monitor}{vendor} ||= $1 if /^\s*VendorName\s+"(.*?)"/;
+ $o->{monitor}{model} ||= $1 if /^\s*ModelName\s+"(.*?)"/;
} elsif (/^Section "Screen"/ .. /^EndSection/) {
- $o->{card}->{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/;
+ $o->{card}{default_depth} ||= $1 if /^\s*DefaultColorDepth\s+(\d+)/;
if (my $i = /^\s*Subsection\s+"Display"/ .. /^\s*EndSubsection/) {
$depth = undef if $i == 1;
$depth = $1 if /^\s*Depth\s+(\d*)/;
if (/^\s*Modes\s+(.*)/) {
my $a = 0;
- push @{$o->{card}->{depth}->{$depth || 8}},
+ push @{$o->{card}{depth}{$depth || 8}},
grep { $_->[0] >= 640 } map { [ /"(\d+)x(\d+)"/ ] } split ' ', $1;
}
}
@@ -80,10 +81,10 @@ sub getinfoFromXF86Config {
sub getinfoFromSysconfig {
my $o = shift || {};
if (my %mouse = getVarsFromSh "/etc/sysconfig/mouse") {
- $o->{mouse}->{xtype} ||= $mouse{XMOUSETYPE};
+ $o->{mouse}{xtype} ||= $mouse{XMOUSETYPE};
}
if (my %keyboard = getVarsFromSh "/etc/sysconfig/keyboard") {
$keyboard{KEYTABLE} or last;
- $o->{keyboard}->{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE});
+ $o->{keyboard}{xkb_keymap} ||= keymap_translate($keyboard{KEYTABLE});
}
}