summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2019-05-11 21:51:45 +0300
committerJani Välimaa <wally@mageia.org>2019-05-11 21:51:45 +0300
commit72abe06410eebd402d2009bc74a0428fde40df08 (patch)
tree502284a59d25d99f6dc52040f212e8dd753b639b /perl-install
parent6c2166b73aac7bd6fe2de646cb24cbe0165f6430 (diff)
downloaddrakx-72abe06410eebd402d2009bc74a0428fde40df08.tar
drakx-72abe06410eebd402d2009bc74a0428fde40df08.tar.gz
drakx-72abe06410eebd402d2009bc74a0428fde40df08.tar.bz2
drakx-72abe06410eebd402d2009bc74a0428fde40df08.tar.xz
drakx-72abe06410eebd402d2009bc74a0428fde40df08.zip
drakautologin: add new functions get_session_file and get_session_file_with_extension
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/any.pm41
2 files changed, 19 insertions, 24 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index b46a58776..294e95a29 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- drakautologin: add new functions get_session_file and get_session_file_with_extension
+
Version 18.16 - 11 May 2019
- Mageia 7 Artwork
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";