summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/xfree.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/Xconfig/xfree.pm')
-rw-r--r--perl-install/Xconfig/xfree.pm83
1 files changed, 73 insertions, 10 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm
index 18fc31e15..ba2c2cedf 100644
--- a/perl-install/Xconfig/xfree.pm
+++ b/perl-install/Xconfig/xfree.pm
@@ -17,16 +17,28 @@ sub new {
################################################################################
sub read {
my ($class) = @_;
- my $file = "$::prefix/etc/X11/XF86Config";
- $file = "$file-4" if -e "$file-4"; #- prefer XF86Config-4 when there is one. Writing will take care of keeping only the new name
- $class->new(Xconfig::parse::read_XF86Config($file));
+ my @files = map { "$::prefix/etc/X11/$_" } 'xorg.conf', 'XF86Config-4', 'XF86Config';
+ my $file = (find { -f $_ && ! -l $_ } @files) || (find { -f $_ } @files);
+ my $raw_X = $class->new(Xconfig::parse::read_XF86Config($file));
+
+ if (my ($Keyboard) = $raw_X->get_InputDevices('Keyboard')) {
+ $Keyboard->{Driver}{val} = 'keyboard';
+ }
+ $raw_X;
}
sub write {
my ($raw_X, $o_file) = @_;
my $file = $o_file || "$::prefix/etc/X11/XF86Config";
if (!$o_file) {
- rename $file, "$file.old";
- rename "$file-4", "$file-4.old"; #- there won't be any XF86Config-4 anymore, we want this!
+ my $xorg = "$::prefix/etc/X11/xorg.conf";
+ foreach ($file, "$file-4", $xorg) {
+ if (-l $_) {
+ unlink $_;
+ } else {
+ rename $_, "$_.old"; #- there won't be any XF86Config-4 anymore, we want this!
+ }
+ }
+ symlinkf 'XF86Config', $xorg;
}
Xconfig::parse::write_XF86Config($raw_X, $file);
}
@@ -45,18 +57,18 @@ sub empty_config {
my @keyboard_fields = qw(XkbLayout XkbModel XkbDisable XkbOptions XkbCompat);
sub get_keyboard {
my ($raw_X) = @_;
- my $raw_kbd = $raw_X->get_InputDevices('Keyboard') or die "no keyboard section";
+ my $raw_kbd = first($raw_X->get_InputDevices('keyboard')) or die "no keyboard section";
raw_export_section($raw_kbd, \@keyboard_fields);
}
sub set_keyboard {
my ($raw_X, $kbd) = @_;
- my $raw_kbd = $raw_X->get_InputDevices('Keyboard') || _new_keyboard_section($raw_X);
+ my $raw_kbd = first($raw_X->get_InputDevices('keyboard')) || _new_keyboard_section($raw_X);
raw_import_section($raw_kbd, $kbd);
_set_Option('keyboard', $raw_kbd, keys %$kbd);
}
sub _new_keyboard_section {
my ($raw_X) = @_;
- my $raw_kbd = { Identifier => { val => 'Keyboard1' }, Driver => { val => 'Keyboard' } };
+ my $raw_kbd = { Identifier => { val => 'Keyboard1' }, Driver => { val => 'keyboard' } };
$raw_X->add_Section('InputDevice', $raw_kbd);
my $layout = get_ServerLayout($raw_X)->{InputDevice} ||= [];
@@ -203,6 +215,47 @@ sub set_wacoms {
################################################################################
+# synaptics ####################################################################
+################################################################################
+sub set_synaptics {
+ my ($raw_X, @synaptics) = @_;
+ $raw_X->remove_InputDevices('synaptics');
+
+ my $layout = get_ServerLayout($raw_X)->{InputDevice} ||= [];
+ @$layout = grep { $_->{val} !~ /^"SynapticsMouse/ } @$layout;
+
+ @synaptics or return;
+ add_load_module($raw_X, "synaptics");
+
+ each_index {
+ my $synaptics_mouse = $_;
+ my $identifier = "SynapticsMouse" . ($::i + 1);
+ my $pointer_type = $synaptics_mouse->{Primary} ? "CorePointer" : "AlwaysCore";
+ my $h = { Identifier => { val => $identifier },
+ Driver => { val => "synaptics" },
+ Device => { val => $synaptics_mouse->{Device}, Option => 1 },
+ Protocol => { val => $synaptics_mouse->{Protocol}, Option => 1 },
+ LeftEdge => { val => 1700, Option => 1 },
+ RightEdge => { val => 5300, Option => 1 },
+ TopEdge => { val => 1700, Option => 1 },
+ BottomEdge => { val => 4200, Option => 1 },
+ FingerLow => { val => 25, Option => 1 },
+ FingerHigh => { val => 30, Option => 1 },
+ MaxTapTime => { val => 180, Option => 1 },
+ MaxTapMove => { val => 220, Option => 1 },
+ VertScrollDelta => { val => 100, Option => 1 },
+ MinSpeed => { val => '0.06', Option => 1 },
+ MaxSpeed => { val => '0.12', Option => 1 },
+ AccelFactor => { val => '0.0010', Option => 1 },
+ SHMConfig => { val => "on", Option => 1 },
+ };
+ $raw_X->add_Section('InputDevice', $h);
+ push @$layout, { val => qq("$identifier" "$pointer_type") };
+ } @synaptics;
+}
+
+
+################################################################################
# monitor ######################################################################
################################################################################
my @monitor_fields = qw(VendorName ModelName HorizSync VertRefresh);
@@ -427,10 +480,13 @@ our @resolutions = (
'800x600',
'1024x480', '1024x768',
'1152x768', '1152x864',
- '1280x960', '1280x1024',
+ '1280x800', # 16/10,
+ '1280x960', '1280x1024',
'1400x1050',
'1600x1200',
- '1920x1200', '1920x1440',
+ '1680x1050', # 16/10
+ '1920x1200', # 16/10
+ '1920x1440',
'2048x1536',
);
@@ -482,6 +538,13 @@ END_PPC
# 1024x480 @ 85.6 Hz, 48 kHz hsync
ModeLine "1024x480" 65.00 1024 1032 1176 1344 480 488 494 563 -hsync -vsync
+ # Dell D800 and few Inspiron (16/10) 1280x800
+ ModeLine "1280x800" 147.89 1280 1376 1512 1744 800 801 804 848
+ # Dell D800 and few Inspiron (16/10) 1680x1050
+ ModeLine "1680x1050" 214.51 1680 1800 1984 2288 1050 1051 1054 1103
+ # Dell D800 and few Inspiron (16/10) 1920x1200
+ ModeLine "1920x1200" 230 1920 1936 2096 2528 1200 1201 1204 1250 +HSync +VSync
+
# TV fullscreen mode or DVD fullscreen output.
# 768x576 @ 79 Hz, 50 kHz hsync
ModeLine "768x576" 50.00 768 832 846 1000 576 590 595 630