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.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 0c7110da9..8cd3ead4c 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -756,6 +756,15 @@ sub adapt_desktop_for_plasma {
return $desktop ? ($h{$desktop} || lc($desktop)) . '.desktop' : '';
}
+sub available_dms() {
+ my @l;
+ foreach (glob("$::prefix/usr/share/X11/dm.d/*.conf")) {
+ my %dm = getVarsFromSh($_);
+ push @l, $dm{EXEC} if $dm{EXEC};
+ }
+ @l;
+}
+
sub get_autologin() {
my %desktop = getVarsFromSh("$::prefix/etc/sysconfig/desktop");
my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf";
@@ -772,7 +781,8 @@ sub get_autologin() {
);
my $dm =
basename(readlink("$::prefix/etc/systemd/system/display-manager.service")) =~ s/(.*)\.service/$1/r ||
- $desktop_to_dm{$desktop};
+ $desktop_to_dm{$desktop} ||
+ basename(first(available_dms()));
my $autologin_user;
if ($dm eq "gdm") {