diff options
author | damien <damien@mandriva.com> | 2000-09-14 00:55:40 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2000-09-14 00:55:40 +0000 |
commit | 200bf96d09d7a36abca57bed28628a337d16c4c8 (patch) | |
tree | 68925ae65f5356caef3575e9645e0f2dd3ea3c2b /perl-install | |
parent | 940c3448ce23ab79a27f5f7aa3b4ade436004f71 (diff) | |
download | drakx-backup-do-not-use-200bf96d09d7a36abca57bed28628a337d16c4c8.tar drakx-backup-do-not-use-200bf96d09d7a36abca57bed28628a337d16c4c8.tar.gz drakx-backup-do-not-use-200bf96d09d7a36abca57bed28628a337d16c4c8.tar.bz2 drakx-backup-do-not-use-200bf96d09d7a36abca57bed28628a337d16c4c8.tar.xz drakx-backup-do-not-use-200bf96d09d7a36abca57bed28628a337d16c4c8.zip |
updated
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Xconfigurator.pm | 9 | ||||
-rw-r--r-- | perl-install/any.pm | 27 | ||||
-rw-r--r-- | perl-install/interactive_gtk.pm | 2 |
3 files changed, 30 insertions, 8 deletions
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 2f2281954..c807cefca 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -1167,7 +1167,7 @@ Would you like X to start when you reboot?"), 1); unless ($::auto || !@users || $o->{authentication}{NIS}) { my $cmd = $prefix ? "chroot $prefix" : ""; - my @wm = map { lc } (split (' ', `$cmd /usr/sbin/chksession -l`)); + my @wm = (split (' ', `$cmd /usr/sbin/chksession -l`)); my %l = getVarsFromSh("$prefix/etc/sysconfig/autologin"); $o->{autologin} ||= $l{USER}; @@ -1178,10 +1178,9 @@ If you don't want to use this feature, click on the cancel button."), [ _("Choose the default user:") => { val => \$o->{autologin}, list => [ '', @users ] }, _("Choose the window_manager to run:") => { val => \$o->{desktop}, list => \@wm }, ]) or delete $o->{autologin}; } - if ($o->{autologin}) { - $::isStandalone ? system("urpmi --auto autologin") : $::o->pkg_install("autologin"); - any::setAutologin($prefix, $o->{autologin}, $o->{desktop}); - } + $o->{autologin} and $::isStandalone ? system("urpmi --auto autologin") : $::o->pkg_install("autologin"); + any::setAutologin($prefix, $o->{autologin}, $o->{desktop}); + run_program::rooted($prefix, "chkconfig", "--del", "gpm") if $o->{mouse}{device} =~ /ttyS/ && !$::isStandalone; } } diff --git a/perl-install/any.pm b/perl-install/any.pm index bc1ed3011..a2237f85d 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -236,8 +236,31 @@ _("Default") => { val => \$default, type => 'bool' }, } sub setAutologin { - my ($prefix, $user) = @_; - setVarsInSh("$prefix/etc/sysconfig/autologin", + my ($prefix, $user, $desktop) = @_; + $user and do { + local *F; + open F, ">$prefix/home/$user/.wmrc" or die "Can't open $!"; + print F $desktop; + close F; + }; + my @wm = (qw(gnome ice maker kde after fvwm fvwm2 fvwm95 mwm twm enligh xfce blackbox sawfish)); + my @wm2 = (qw(gnome-session icewm wmaker kdestart afterstep fvwm fvwm2 fvwm95 mwm twm enlightenment xfce blackbox sawfish)); + my $i=0; + foreach (@wm) { + lc($desktop) =~ /$_/ and $desktop = $wm2[$i] and last; + $i++; + } + my $f = "$prefix/home/$user/.xinitrc"; + -e $f or do { + open F, ">$f" or die "Can't open $!"; + print F "# Mandrake-Autologin : if you remove this comment, I won't ever edit this file."; + close F; }; + cat_($f) =~ /^# Mandrake-Autologin.*\n/ and do { + substInFile { + s/^exec .*\n//; + $_ = "exec $desktop\n" . $_ if eof; + } "$prefix/home/$user/.xinitrc"; }; + setVarsInSh("$prefix/etc/sysconfig/autologin", { USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx" }); } diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm index 63497f520..2e54ff5ad 100644 --- a/perl-install/interactive_gtk.pm +++ b/perl-install/interactive_gtk.pm @@ -48,7 +48,7 @@ sub ask_from_list_with_helpW { $::isWizard and my $pixmap = new Gtk::Pixmap( gtkcreate_xpm($w->{window}, $::wizard_xpm)) || die "pixmap $! not found."; $::isWizard and gtkset_usize($w->{rwindow}, 500, 400); my $rc = "/etc/gtk/draknet.rc"; - -r $rc or $rc = dirname(__FILE__) . "/draknet.rc"; + -r $rc or $rc = common::dirname(__FILE__) . "/draknet.rc"; Gtk::Rc->parse($rc); my $style = $w->{rwindow}->style->copy(); $style->bg_pixmap(0); |