From bd64f38c689f6cb779d9ea6442964095d6db9037 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 20 Jun 2016 15:09:36 -0400 Subject: Setup a recursive xinit call within the start-lumina-desktop binary as needed. This should detect if an X session is already active, and startup X if not. --- src-qt5/core/lumina-session/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-session') diff --git a/src-qt5/core/lumina-session/main.cpp b/src-qt5/core/lumina-session/main.cpp index 27eaf537..464302a7 100644 --- a/src-qt5/core/lumina-session/main.cpp +++ b/src-qt5/core/lumina-session/main.cpp @@ -29,6 +29,14 @@ int main(int argc, char ** argv) qDebug() << "Lumina does not appear to be installed correctly. Cannot find: " << LOS::LuminaShare(); return 1; } + //Start X11 if needed + QString disp = QString(getenv("DISPLAY")).simplified(); + if(disp.isEmpty()){ + //No X session found. Go ahead and re-init this binary within an xinit call + QStringList args; args << QCoreApplication::applicationFilePath(); + if(LUtils::isValidBinary("x11vnc")){ args << "--" << "-listen" << "tcp"; } //need to be able to VNC into this session + return QProcess::execute("xinit", args); + } //Setup any initialization values LTHEME::LoadCustomEnvSettings(); LXDG::setEnvironmentVars(); @@ -37,7 +45,7 @@ int main(int argc, char ** argv) unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default... //Check for any missing user config files - //Start X11 if needed + //Configure X11 monitors if needed if(LUtils::isValidBinary("lumina-xconfig")){ -- cgit