summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorNicolas Salguero <nicolas.salguero@laposte.net>2016-08-13 02:58:42 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-08-13 02:59:39 +0200
commit11ae13b95669baae4bff3364bcd53a3dd05a75a8 (patch)
treea50d58a196ff131909c806fff0daafbb18366985 /perl-install/any.pm
parent8f9a14c783f0c60b66e11a46fcbb22c1b1311d3a (diff)
downloaddrakx-11ae13b95669baae4bff3364bcd53a3dd05a75a8.tar
drakx-11ae13b95669baae4bff3364bcd53a3dd05a75a8.tar.gz
drakx-11ae13b95669baae4bff3364bcd53a3dd05a75a8.tar.bz2
drakx-11ae13b95669baae4bff3364bcd53a3dd05a75a8.tar.xz
drakx-11ae13b95669baae4bff3364bcd53a3dd05a75a8.zip
add support for LXDM (mga#17616)
need desktop-common-data-6.2+ perl_checker cleanups by Thierry Vignaud
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm26
1 files changed, 24 insertions, 2 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 1cf6d3841..e809ed7af 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -680,6 +680,7 @@ sub get_autologin() {
my $gdm_file = "$::prefix/etc/X11/gdm/custom.conf";
my $sddm_file = "$::prefix/etc/sddm.conf";
my $lightdm_conffile = "$::prefix/etc/lightdm/lightdm.conf.d/50-mageia-autologin.conf";
+ my $lxdm_conffile = "$::prefix/etc/lxdm/lxdm.conf";
my $autologin_file = "$::prefix/etc/sysconfig/autologin";
my $desktop = $desktop{DESKTOP} || first(sessions());
my %desktop_to_dm = (
@@ -708,6 +709,10 @@ sub get_autologin() {
} elsif ($dm eq "lightdm") {
my %conf = read_gnomekderc($lightdm_conffile, 'Seat:*');
$autologin_user = text2bool($conf{'#dummy-autologin'}) && $conf{"autologin-user"};
+ } elsif ($dm eq "lxdm") {
+ my %conf = read_gnomekderc($lxdm_conffile, 'base');
+ $autologin_user = $conf{autologin};
+ $autologin_user =~ s/^.//;
} else {
my %conf = getVarsFromSh($autologin_file);
$autologin_user = text2bool($conf{AUTOLOGIN}) && $conf{USER};
@@ -718,7 +723,7 @@ sub get_autologin() {
sub is_standalone_autologin_needed {
my ($dm) = @_;
- return member($dm, qw(lxdm slim xdm));
+ return member($dm, qw(slim xdm));
}
sub set_autologin {
@@ -755,8 +760,25 @@ sub set_autologin {
'autologin-user' => $autologin->{user}
)) } if -e $lightdm_conffile;
+ #- Configure LXDM
+ my $lxdm_conffile = "$::prefix/etc/lxdm/lxdm.conf";
+ eval { update_gnomekderc($lxdm_conffile, 'base' => (
+ if_($autologin->{user}, 'autologin' => '@' . $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,
+ )) } } if -e $lxdm_conffile;
+
my $xdm_autologin_cfg = "$::prefix/etc/sysconfig/autologin";
- # TODO: configure lxdm in /etx/lxdm/lxdm.conf
if (is_standalone_autologin_needed($autologin->{dm})) {
setVarsInShMode($xdm_autologin_cfg, 0644,
{ USER => $autologin->{user}, AUTOLOGIN => bool2yesno($autologin->{user}), EXEC => '/usr/bin/startx.autologin' });