summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm41
1 files changed, 17 insertions, 24 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 96d201565..d89b04d6f 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -748,13 +748,21 @@ sub setupBootloader__grub2 {
}
}
-sub adapt_desktop_for_plasma {
+sub get_session_file {
my ($desktop) = @_;
- my %h = (
- 'Plasma' => '01plasma',
- 'GNOME Classic' => 'gnome-classic',
- );
- return $desktop ? ($h{$desktop} || lc($desktop)) . '.desktop' : '';
+ my $xsession_file = find {
+ my %xsession = read_gnomekderc($_, 'Desktop Entry');
+ $xsession{Name} =~ s/\s+//g;
+ $xsession{Name} eq ${desktop};
+ } glob("$::prefix/usr/share/xsessions/*.desktop");
+ $xsession_file =~ s!\.[^.]+$!!;
+ $xsession_file =~ s!.*/!!;
+ $xsession_file ||= $desktop;
+ return $xsession_file;
+}
+
+sub get_session_file_with_extension {
+ return get_session_file(@_) . '.desktop';
}
sub available_dms() {
@@ -828,7 +836,7 @@ sub set_autologin {
#- Configure SDDM
my $sddm_conffile = "$::prefix/etc/sddm.conf";
eval { common::update_gnomekderc_no_create($sddm_conffile, 'Autologin' => (
- Session => adapt_desktop_for_plasma($autologin->{desktop}),
+ Session => get_session_file_with_extension($autologin->{desktop}),
User => $autologin->{user},
)) } if -e $sddm_conffile;
@@ -841,18 +849,10 @@ sub set_autologin {
#- Configure LIGHTDM
my $lightdm_conffile = "$::prefix/etc/lightdm/lightdm.conf.d/50-mageia-autologin.conf";
- my $xsession_file = find {
- my %xsession = read_gnomekderc($_, 'Desktop Entry');
- $xsession{Name} =~ s/\s+//g;
- $xsession{Name} eq $autologin->{desktop};
- } glob("$::prefix/usr/share/xsessions/*.desktop");
- $xsession_file =~ s!\.[^.]+$!!;
- $xsession_file =~ s!.*/!!;
- $xsession_file ||= $autologin->{desktop};
eval { update_gnomekderc($lightdm_conffile, 'Seat:*' => (
'#dummy-autologin' => $do_autologin,
'autologin-user' => $autologin->{user},
- 'autologin-session' => $xsession_file,
+ 'autologin-session' => get_session_file($autologin->{desktop}),
)) } if -e $lightdm_conffile;
#- Configure LXDM
@@ -861,16 +861,9 @@ sub set_autologin {
'autologin' => $autologin->{user} ? '@' . $autologin->{user} : ''
));
if ($autologin->{user} && $autologin->{desktop} && !member($autologin->{desktop}, qw(default failsafe))) {
- my $xsession_file = find {
- my %xsession = read_gnomekderc($_, 'Desktop Entry');
- $xsession{Name} eq $autologin->{desktop};
- } glob("$::prefix/usr/share/xsessions/*.desktop");
- $xsession_file =~ s!\.[^.]+$!!;
- $xsession_file =~ s!.*/!!;
- $xsession_file ||= $autologin->{desktop};
update_gnomekderc($lxdm_conffile, $autologin->{user} => (
'user' => $autologin->{user},
- 'session' => $xsession_file,
+ 'session' => get_session_file($autologin->{desktop}),
)) } } if -e $lxdm_conffile;
my $xdm_autologin_cfg = "$::prefix/etc/sysconfig/autologin";