diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-07-28 22:02:39 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-07-28 22:02:39 +0000 |
commit | ee295df5670f73b285e3de0cea0fdae7d92941bd (patch) | |
tree | 1dbff785561e08dd894473b3c3b223fb1b68e081 /perl-install/Xconfig/default.pm | |
parent | 70fd8ae05409bb33818da725015daf181c6e6a83 (diff) | |
download | drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.gz drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.bz2 drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.tar.xz drakx-ee295df5670f73b285e3de0cea0fdae7d92941bd.zip |
14 new modules, will it be enough?? :)
Diffstat (limited to 'perl-install/Xconfig/default.pm')
-rw-r--r-- | perl-install/Xconfig/default.pm | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/perl-install/Xconfig/default.pm b/perl-install/Xconfig/default.pm new file mode 100644 index 000000000..6801eb49a --- /dev/null +++ b/perl-install/Xconfig/default.pm @@ -0,0 +1,67 @@ +package Xconfig::default; # $Id$ + +use diagnostics; +use strict; + +use Xconfig::xfree; +use keyboard; +use common; +use mouse; + + +sub configure { + my ($keyboard, $mouse) = @_; + + $keyboard ||= keyboard::read($::prefix); + $mouse ||= $::noauto ? mouse::read($::prefix) : mouse::detect(); + + + my $raw_X = Xconfig::xfree->empty_config; + + $raw_X->{xfree4}->add_load_module($_) foreach qw(dbe v4l extmod type1 freetype); + + config_keyboard($raw_X, $keyboard); + config_mouse($raw_X, $mouse); + + $raw_X; +} + +sub config_mouse { + my ($raw_X, $mouse) = @_; + mouse::set_xfree_conf($mouse, $raw_X); + if (my @wacoms = @{$mouse->{wacom} || []}) { + $raw_X->set_wacoms(map { { Device => "/dev/$_", USB => m|input/event| } } @wacoms); + $raw_X->{xfree3}->add_load_module('xf86Wacom.so'); + } +} + +sub config_keyboard { + my ($raw_X, $keyboard) = @_; + + my $XkbLayout = keyboard::keyboard2xkb($keyboard); + + if (!$XkbLayout || $XkbLayout =~ /([^(]*)/ && !-e "$::prefix/usr/X11R6/lib/X11/xkb/symbols/$1") { + my $f = keyboard::xmodmap_file($keyboard); + cp_af($f, "$::prefix/etc/X11/xinit/Xmodmap"); + $XkbLayout = ''; + } + + { + my $f = "$::prefix/etc/sysconfig/i18n"; + setVarsInSh($f, add2hash_({ XKB_IN_USE => $XkbLayout ? '': 'no' }, { getVarsFromSh($f) })) if !$::testing; + } + + my $XkbModel = + arch() =~ /sparc/ ? 'sun' : + $XkbLayout eq 'jp' ? 'jp106' : + $XkbLayout eq 'br' ? 'abnt2' : 'pc105'; + + my $xkb = { $XkbLayout ? ( + XkbLayout => $XkbLayout, + XkbModel => $XkbModel, + ) : (XkbDisable => undef) }; + $raw_X->set_keyboard($xkb); +} + +1; + |