From aabb6ce2cfd615338503a0800da9502bd9453d2e Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Mon, 13 Sep 2021 14:14:03 +0200 Subject: Autostart a lecture if the SLX_AUTOSTART_UUID file exists in config_override --- src/main.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index df7309c..65cc14c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,6 +9,11 @@ #include #include +#include +#include +#include +#include + #include #include #include @@ -123,13 +128,19 @@ int main(int argc, char *argv[]) { w.show(); - if (Config::isSet(Config::AUTOSTART_UUID)) { + // First check if theres an override file for the SLX_AUTOSTART_UUID + QString fileName("/var/lib/lightdm/config_overrides/SLX_AUTOSTART_UUID"); + QFile file(fileName); + if (QFileInfo::exists(fileName)) { + file.open(QIODevice::ReadOnly); + QString data = file.readAll(); + qDebug() << "using startSession() from main.cpp (autostart uuid from override file)"; + w.startSession(data.simplified()); + } else if (Config::isSet(Config::AUTOSTART_UUID)) { qDebug() << "using startSession() from main.cpp"; w.startSession(Config::get(Config::AUTOSTART_UUID)); } - - // center dialog on primary screen QPoint center = desktopRect.center(); w.move(center.x() - w.width() / 2, center.y() - w.height() / 2); -- cgit v1.2.3-55-g7522