Skip to content

Commit

Permalink
Change /etc/sddm.conf as root
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianTM committed Jul 30, 2024
1 parent 945eb42 commit defbb26
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,10 @@ void MainWindow::applyOptions()
+ " /etc/lightdm/lightdm.conf");
}
if (QFile::exists("/etc/sddm.conf")) {
QSettings sddm_settings("/etc/sddm.conf", QSettings::NativeFormat);
shell->runAsRoot(QString("sed -i 's/^User=.*/User=%1/' /etc/sddm.conf").arg(user));
if (qEnvironmentVariable("XDG_CURRENT_DESKTOP") == "KDE") {
sddm_settings.setValue("Autologin/Session", "plasma.desktop");
shell->runAsRoot("sed -i 's/^Session=.*/Session=plasma.desktop/' /etc/sddm.conf");
}
sddm_settings.setValue("Autologin/User", user);
}
QMessageBox::information(this, tr("Autologin options"),
(tr("Autologin has been enabled for the '%1' account.").arg(user)));
Expand Down

0 comments on commit defbb26

Please sign in to comment.