summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2000-09-14 00:55:40 +0000
committerdamien <damien@mandriva.com>2000-09-14 00:55:40 +0000
commit200bf96d09d7a36abca57bed28628a337d16c4c8 (patch)
tree68925ae65f5356caef3575e9645e0f2dd3ea3c2b /perl-install/any.pm
parent940c3448ce23ab79a27f5f7aa3b4ade436004f71 (diff)
downloaddrakx-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/any.pm')
-rw-r--r--perl-install/any.pm27
1 files changed, 25 insertions, 2 deletions
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" });
}